December 28, 2018

Using namespace std

Seems like it was just yesterday when I was programming with some classmates and strangers at a project Euler sprint when the unknown happened. As we were working on the problem I quickly opened my text editor and begin typing out the boiler code. Type,type,tyep…type.

using namespace std;

WOHHH WOHH don’t do that!
What do you mean?
You are importing the entire namespace library.

At this point in my programming journey, I was somewhat new to C++ and only worked extensively with C thus it never crossed my mine when importing the entire stdlib library. I was simply programming without thinking how such an import could save us time when solving time constraint problems.

Why is using namespace std considered bad practice

After that particular meetup, I was intrigued by why such a statement was bad practice and dove deeper to broaden my understanding. Often times when programming we programmers tend to import or use libraries for tedious tasks.

What I found was when you declare using namespace std you are importing the entire namespace library and given your experience you may only use a few of the provided functions declared in c++ standard library.

Use only what you need

Ever since that particular meetup I have written every program in such a way that I only import namespaces that are needed. This has also helped with readability and avoids naming collision especially when using c++ libraries such as boost which may have similar or the exact same namespaces as the standard library.

November 6, 2012

Challenging yourself by solving problems everyday

Hello fellow readers, welcome to my new personal site. I have always wanted to start a personal blog for some years now and finally decided to just do it. I created this blog for my personal use and of course for you to follow me or learn something from me along the way. I am in the process of trying to complete my degree in computer science and would love to look back on all the things and events that I have experience from here on out. If you’re interested in learning more about me or the type of work I specialize in, check out my portfolio website cell- designs.  

2 years ago I officially decided that I would like to become a back-end programmer rather then just a front-end developer. I loved designing and creating websites for the frontend but I wanted to dive into the dark stuff and create web applications. Ever since I was a kid I always challenged myself in everything I decided to do.  Maybe I would play a video game and try to beat the game in 24hours, get an A on a school test, or I would take apart my bikes to make one good one. Though I was not sure the bike would work or that I would beat a video game or even ace the test at school I knew that I was trying and learning along the way.  

Everyday is a new day and a day to challenge yourself. Ever since I started to write code in terms of programming (Ruby, PHP etc) I’ve wanted to solve problems and that is what I am doing. I figured the best way or challenging your brain is to push yourself everyday to solve a problem. Though I was solving problems in my earlier days of writing code, I did not fully understand what I was solving but now I am making myself aware and setting my goals high. Everyday I have been solving math problems, writing new features into my web application, and of course writing it down in my blog.  I plan to take everyone who would love to follow me on my journey of pursuing a degree in computer science. In this blog you find pictures, blogs, videos, short quotes, and everything that inspires, bugs or motivate me as a young individual. That is all for this note and if you’ve read this far you’re a brave one. Much success to everyone who is trying to make a difference in the world and solve problems daily.