Wednesday, 19 March 2014

How to start thinking like a programmer..

Very simple funda. If have a mind, and you are often using it. You are eligible for programming. C is easiest one(*conditions apply) of all the programming languages. I would strongly prefer C as a pre-requisite for all who wants to become a programmer. You can learn all the basic essentials of the programming. Lets C it.

There is one common thing that I have observed in the beginners: That is Rush(running from program to program without having a pause for quality). I can code the sum of two integers in one way(say a 10 lines) since it is so simple, another programmer may code it in just a 5 lines. Once you starting analyzing you code even after successful execution, you will be learning the real programming. Make it simple. 

Take time and lets say one day that you took time and now you have became an expert rather than struck with saying I do not know how the internal process works. Move to another topic only if you are completely satisfied with the topic.

How to think to code. Computer is a best servant to us. It will do whatever we will say to it in an understandable manner. Do not talk with someone without having proper image in your mind. 

Suppose you need to catch a flight that is going to take off in next hour and your are far from the airport. Think if you take a city bus it will take 2 hours to reach, if you go by your car it may take 1.5 hours. There is one more option, it you go by train, you may reach the airport within next 40 minutes. Obviously you will go for third option which suits the situation. The same applies here in programming. Your duty here is to fix the right things at the right place. If you practice it I can assure that you will become one of the top programmers in the world.

Once you are able to fix the things, start writing down the code on a paper. The next thing you have to do is typing it and compiling. Here comes the major problem. If there are any errors in the code simply you can modify the code on the computer and execute it. I would strongly recommend not do practice it this way. If there are any errors, come back to the code on the paper and start tracing from the first line. The next minute you will be a master in modifying the error.

The next step is to start writing code to know a number is prime or not and nothing else....Good luck!