” Wake up in the morning
feeling like p-diddy
grab my glasses
I’m out the door
I’m gonna hit the city
before I leave brush my teeth with a bottle of jack
’cause when I leave for the night I ain’t coming back “
Yeah I know, this isn’t really a politzer winning poem, or a healthy style of living,
It is however a lot like how a computer think!
A computer program usually comes to solve some sort of problem or simulate a situation.
In order to do that, one has to break down the tasks to perform into basic instructions so that the computer won’t miss any detail, and that my friends – requires some planning.
Imagine you’re to build a house. If you won’t use a well planned architecture you’ll probably
have a lot of issues building that house. The foundations have to be strong, the walls straight and the roof has to be 100% water proof for example.
It’s the same with computers.
A programmer has to follow a few steps before even writing th first line of code:
//and figure out the sequence of events!
/*Probably some I/O operations as well but we’re not gonna be talking
about them just yet */
Those of you who noticed I used a bit of C/C++ syntax there – well done! Though it’s just cosmetics within the scope of this post.
So I believe with just a little effort even Ke$ha can become a programmer. Actually, let’s have a bit of fun and show Ke$ha how exactly we can turn the “tik tok” lyrics into a computer program flow if we only change the order of the lines a bit:
I know I know, It’s not exactly intuitive, oh you didn’t care about that and thought I don’t have a life? Rude. True, but rude!
Seriously though, you should really follow these guidelines if you wish to write code that works and runs without any unexpected behaviors (more on that later) every time you run it! I know enough programmers (or hacker wannabes) who don’t go through this procedure when designing their code and let me tell you this – it shows. The outcomes are just not good; programs crush, causing memory leaks and even crushing the system and expose the computer to security breaches (don’t worry we’ll get there).
DON’T BE LAZY! Walk the extra mile! That’s what differentiate between the mediocre and the expert.
Also, don’t think you’re super smart and talented you can jump straight to writing code – always plan ahead, even if it’s just a simple recursive file infecting virus program (academic, naturally).
I’m off to do something useful with my life.
Nope, probably not,