How I learn to program: The tools of the trade

This is a continuation of the last post. I’m going into what are the actual tools you need to start on the way to becoming a programmer, where you can get them and how to put them to use.A Brief Introduction
Before I start on what tools to actually use, let me give you some background on computer languages and programming. If you already know all about that, move on. The basics are pretty simple: The only thing that computers really understand is a string of 1’s and 0’s, that is, on and offs for the processors many transistors. However writing instructions in this binary language is enough to drive anyone mad after some time. Over the fifty years or so that computers have been around, many alternatives have been developed to allow people to program by using a language closer to everyday English. This process started off with assembly language, hexadecimal codes and continues upto today’s languages of C++, Java, Python etc. But all the same computers still understand only binary. So you need something that will take your close-to-English program and turn it into computerese binary. This task is done either by a compiler or an interpreter.
Now, both a compiler and an interpreter do essentially the same task of translating your program to binary. But they do it in slightly different ways. A compiler ploughs through the whole program, checks for grammatical (syntax) errors and then spits out a binary equivalent. You can then run this binary equivalent whenever you like. Though this method generates fast and efficient binary code, the problem is that if you’ve made a non-grammatical error (like told the program to say “no” when it should have said “yes”), you have to wait for the whole thing to compile before finding out what the error was, and once you’ve fixed it, you have to compile it again. As you can well imagine, this process can be time consuming.
Interpreters sidestep this whole program altogether. An interpreter reads a line of program code at a time, translates it to binary, and executes it then and there. The good news is that this makes error checking a lot faster. But on the down side, program execution can be somewhat slower as the interpreter does a lot more work than just execution. There is also the added hassle of needing an interpreter installed anywhere that you want to run the program.
However, some languages, most notably Java, use a combination of the two. First your source is compiled into an intermediate language called a bytecode. At this stage you get to correct your grammatical errors. This bytecode is then interpreted into binary and executed by a Virtual Machine. The advantage this has over normal interpreted code is that you don’t have to move around the source code, only the bytecodes, and you just need a virtual machine instead of a full-fledged interpreter.

The Tools
    Now that you know all the theory about computer languages, time for some practical work. So what do you need to get started programming? Firstly a computer; secondly, an operating system. You probably use Windows, but Linux is much better for programming. If you’re reading this you probably have both. Then to really start programming, you need just two things: a text editor and a compiler/interpreter for your language. A text editor is where you type in your program. After you’ve finished typing, save the file with the appropriate main and extension and then hand it over to you compiler.
Compilers can generally be run from the command line. Each compiler has to be called in a slightly different way, but in general you just have to type in the name of the compiler followed by your program’s file name. That’s all. For C++, you can’t go wrong with the open source GCC compiler. It’s been around for years and has proven its worth many times over. If you feel like a cup of Java, it’s probably best to go in for Sun’s own free SDK. There is an open source Java compiler called the GCJ, but it’s still quite new and you might want to wait a while before starting on it. However if you’re new to programming, I do recommend starting off with Python. You can get all the things you need from If you’re on Linux, the C++ compiler and Python interpreter will probably be preinstalled. If you’re on Windows, you’ll have to download and install them separately.
It’s another story for text editors though. Text editors are a dime a dozen. Some are very basic, some are very advanced. It’s up to you to find the one with the features to match your preferences. If you’re on Windows, you might want to try out the ConText editor. It’s simple, easy to use and highly customizable (and my first real editor). On Linux Kate and Gedit are extremely good. Of course, if you want to feel a bit more sophisticated, you might want to check out Vim or Emacs. Don’t let them scare you though.
Of course, the whole command line thing might get very tiring after a little while. Though it is the best way to start off and many will argue that it’s all that you’ll ever need for the job (which is true), it can be more aesthetic to use an IDE to automate some things. But be warned: Most IDE’s are incredibly complex and feature packed gadgets. Like any tool, their use has to be learned carefully and they can be quite intimidating to people who don’t know what they’re doing. You probably shouldn’t go near them until you get around to writing reasonably big programs. That being said, there are some IDE’s which even relatively new programmers can use without getting overwhelmed. For C++ on Windows, Bloodshed Dev is very clean and streamlined and is forgiving for new users. On Linux you could take Anjuta for a spin. KDevelop is also a big favourite, but you won’t be using most of it’s features unless you’re writing big, multiple source file projects. There are a number of Python IDE’s available on both Windows and Linux. The IDE that Python comes with is IDLE, and it is very clean. Just type your code and press a button to run it. Simple. Once you get bored with that, you could try out others like Eric3 or SPE. I personally use SPE because I find Eric3 too cluttered. For Java, Eclipse is a really great IDE, but it’s a memory hog and if you don’t have the resources, you’ll soon be screaming “Give me back my RAM and clock-cycles”. I personally find BlueJ very nice. It was my first IDE ever and I think that it achieves its purpose of letting you “learn the language without learning the IDE”.

That should give you enough information to get out there and do some coding. The reason that I’ve focussed on C++, Java and Python is that most people that I know started programming on C++ or Java and that Python really is a very good starter’s language. It’s simple to use, easy to run, unlike C++ and Java there are few set rules which allow you to proceed at your own pace and develop your style of programming. Have fun coding and remember that most of the tools I’ve listed are Open Source and all are free. So once you do become a master coder, please give back to the community that helped you on your way.

Tags: , , C++, Java

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s