Monday, August 8 2011, 10:35 am

Yearning to Learn Computer Programming?

Controlling the flow of electricity inside your computer is a phrase that sounds better than the noun I will blab about today: programming. Sure, you could read a "How-to Program in 30 Minutes!" book or Google search another blog for a lesson or two, but if you want to understand why instead of how programs function then please pay attention.

What programming language should I learn first?

Say what again. I dare you. Wrong question to ask. Understanding concepts and having common sense are far more important than the language. Those two qualities will carry over across multiple languages unless the language itself is poor. Specifically you must understand that your code must be generic and modular. These are not new concepts, but they are easily overlooked or not mentioned any more. Modern texts teach specific language techniques that get you running a basic program quickly, but when you attempt your own program you end up with something that will not compile.

Programming: think, design, analyze

Please be prepared to spend hours on a simple problem. If the first solution you think of involves a globally accessible variable and calling it directly across three functions there is probably another solution that puts the variable in a restricted name space. Never take the easy way out until you are certain it is the only way out. If in doubt speak out! Ask questions among other programmers and see if your idea is worth the bytes used to store it.

Redesign is fine

It is rare for me to accept the code I write the first time as good code. With this in mind, you should be prepared to see the code you write in the future. Don't become too attached to it as you may find out it has serious bugs that may require you to completely rewrite the code. Plan ahead by not only leaving good comments, but clearly defining test blocks. I have seen older code blocks with tests that are not obvious until I study three other source files. It should never take longer than a few minutes to catch up on code you have not seen in a while.

Show me the money

Ready to start programming? Start with globally used, free tools. The C and Python languages have large open source communities with tools that work on Windows, Linux, and OS X. Don't forget to save any code you write into a version control system. Git is a good start. Using git alone is a good test to see if you can make it as a programmer or not.