Saturday, April 3, 2010

Top Programming Myths

Each one of us often wonders - how do we become good programmers? And that question becomes much more predominant if you’re going to get an engineering degree within a period of four years.
First, let us shatter some misconceptions. The first one is what most students believe – the more programming languages I learn, the better I will become. Wrong. In fact, you couldn’t be more wrong. Programming is like poetry. And when you try a different programming language, it becomes more or less the same situation where you switch to completely different writing language and try to come up with meaningful poems. In fact, a new programming language will only result in the overhead of adapting to the syntactical changes.
The second of most prevalent misconceptions – I should learn programming from a book. Let us ask you a question from the perspective of poems again – which poet do you know of, learnt poetry from an English grammar book? Again, programming is something best learnt through experience. Yes, a reference book is definitely going to help, but it is not going to be a source of new ideas in terms of algorithms. A programming language book is only going to explain to you the grammar of the language, the syntax. It will not inculcate in you the skill to come up with an algorithmic solution to a problem.
The third – those who took programming in their high school can only be good at it. Again, false. Programming is like mathematics and poetry combined. You can learn and master programming at any stage in life, given you move in the right direction with it.
Okay, enough myth-busting. Let’s get down to ‘how to learn programming’. The key my friends, is experience combined with a sharp analytical skill. First, one needs to learn how to effectively translate and break every situation down into a programming problem. Almost everything encountered in engineering can be put in terms of programming. Once you’re able to do that, half the work is done.
The next stage is the planning and analysis. Hold your horses before you reach out for the keyboard and begin coding. First, get yourself some old fashioned piece of paper and a pencil. Now, analyse the problem statement mathematically. Take some cases, try them out, see how the math flows. Next, move on to the more extreme cases and see if the flow of things is still the same. If not, repeat the previous step, until you begin to get the drift of things.
Now comes the part where your computer and the compiler are your best friends. You’ve done the planning, you’ve done the analysis, it’s now time to sit down, and code. In real programmer vocabulary, this part is not as exciting as the planning and analysis part. Ask any good programmer and you’ll find out.
So what do we conclude from this? Firstly, you need to know just one programming language. Yes, classical computer science doesn’t need you to know more than one. A programming language is just a way of translating mathematics into a computer’s language.
Secondly, try programming more for mathematical situations rather than things like sockets and other such utilitarian pieces of code. Unless you’re really interested in run of the mill Information Technology, you don’t need to know much about such code.
Thirdly, spend more time with a pencil and a paper than an IDE. Imagine more, and think in terms of mathematics.
Fourthly, get an algorithmic bent of mind. Instead of issuing a reference book from the library, buy yourself a copy of a hardcore algorithmic bible like “Introduction to Algorithms” by CLRS or “The Art of Computer Programming” by Donald E. Knuth.
Lastly, patience. Which of course, all of you who have read till this line, have.
Cheers and happy coding.

No comments:

Post a Comment