The principles of good programming skills
Smitha Prasad
Often parents ask me, “It must be really difficult to write computer programs, isn’t it? My child wants to become a computer programmer? Can he/she do it”?
I keep telling people, if your child wants to write computer programs, let the child do it. I can’t say whether it is easy or not but definitely if you are passionate and curious enough about solving problems, then I am sure you are moving in the right direction. As I keep thinking on these lines, these are some things I did while I learnt to code on my own.
As a student I was a very bad programmer. Can you believe I used to memorize the programs? I never understood the basics as I never bothered to read and understand them. I even mugged up a semicolon and a full stop… without knowing why they were used. If my programs worked it was sheer luck. They were at the mercy of my memory! Most of the times my codes ended up with a lot of errors as my memory showed me no mercy.
Now when I teach my students, I keep telling them how important it is to learn the basics well so that they don’t face the difficulties I faced as a student.
Here are some tips to code at ease.
Learn the basics: There is no substitute. It is a little boring to learn the syntax and language basics when you start. But you have to learn it thoroughly as it will take you a long way and coding will become as easy as playing.
Curiosity about computers and how technology works will definitely make you successful as a programmer. So just start the voyage.
Develop the ability to solve problems yourself: All programming languages have documentation and specifications that can be easily understood about how the language works. When you see something you don’t understand or recognize, immediately ask someone or Google it! Reading the documentation helps to build your skills as a programmer. The fun of programming is in solving problems.
Break down the problem into smaller units.
A simple algorithm to walk will be something like this:
1. Lift your left foot.
2. Move it forward.
3. Put it down.
4. Lift your right foot.
5. Move it forward.
6. Put it down.
If these instructions are repeated then they make you walk!
Whenever you start working on a problem you will definitely encounter a whole “stack” of them. And when you think you have resolved one problem, there is another. Remember you are making progress, but there are always new problems to face. As you progress, if the code works, great, if it doesn’t, find a new way.
Be persistent: Don’t give up easily. Your first program may not work. Don’t be disappointed. Keep writing code and keep trying.
Keep celebrating every small win: Whenever you solve a problem and the program that you struggled with runs successfully, no matter how small, always take pride in your accomplishment and enjoy your success. The feeling of success will make you confident in solving more problems.
Think innovatively and be creative: There are numerous ways to solve a problem, and through knowledge and experience, you will develop an understanding eventually about which solutions are better.
Pay attention to detail: A successful programmer will never overlook little things. Computers are precise machines. You need to provide the necessary commands precisely in the way a computer expects. If you don’t, nothing will work. A space, dot, bracket, or semi-colon is important. When the computer gives an error message, you have to be able to look at that message and understand exactly what it is telling you. It may be a simple typing mistake and if you miss details, you could spend hours tracking down a problem.
Programming may not be a very easy task at the beginning but certainly if you practice you can learn. So just begin the journey and start coding if you are interested in learning to program.
The author is an Electronics and Communications Engineer. She is now a computer science teacher at The Brigade School, Bengaluru. She can be reached at smithagprasad@gmail.com.