Monday, October 1, 2012

How to Learn Your First Programming Language


Introduction

Programming is a very useful and rewarding hobby. There are few better feelings than when someone sees you using a program you lashed together to make your life easier and says that it looks really useful. Most people have, at some point in their lives, really wanted to be able to do something on their computer or phone and been unable to. If you know a programming language, then there is often a fair chance that you can write a program to accomplish that task yourself. While there are a huge number of programming languages, many of them have a lot of similarities; this means that once you learn one language quite well, in most cases you will be able to pick up a new one far quicker.
Limits
One thing that all new programmers must come to term with is the amount of time learning a programming language takes. Although when you have become an expert you will be able to write many programs quickly, you must remember that many programs have taken whole teams of expert developers years to create. So it is important to understand that knowing a programming language or even several is not enough to write some of the more complex programs you have seen. Don't look upon this new hobby as a way to save yourself a lot of money, as writing your own version of most of the programs that you need to pay for now will be out of your reach.
The most important thing that a new programmer needs to know is that the "Learn Programming in 24 hours" sort of books are simply not true. A more accurate title would be "Learn Programming in 10,000 hours". If you put 24 hours or a week into learning a language you will not be creating the next Windows or a new, state of the art game. It is possible to learn to write a program in 10 minutes, and really all you need to learn a new language is your favourite search engine, but you will not be an expert. The only way to become an expert is much like learning the violin; the answer is practice, practice and practice some more.
Selecting Your First Language
Now that we have examined the limitations and handled some of the more unrealistic expectations, those of you still wanting to learn to code will be happy to know that programming is not a hard thing to start learning and will not require you to pay out huge sums of money. If you are reading this article on-line, you already have the resources to start with some languages, so let us consider what your first language ought to be.
Traditionally the first language a programming newcomer learns is either Visual Basic or Python. The first thing to understand is that these two languages are very different. The simplest difference is one of price. Python is totally free; you can start writing python now with just a text editor on your computer, though if you are on Windows, you will probably need to install it first. However Visual Basic, often abbreviated to VB, is both free and not free. On the upside, VB can be simpler for newcomers to learn because it allows you to build the interfaces (the part of the program the user will see) by dragging and dropping the different parts much like designing it in some basic art application. The version of VB newcomers learn is usually Visual Basic 6, but this is rather outdated and has been discontinued. So these days the version learned is often VB.NET which can be considerably less simple for newcomers.
VB.NET must be developed inside what we call an IDE (Integrated Development Environment); this is basically a special program you use to write other programs. They also exist for Python, but their use is totally optional. The free VB.NET IDE is called Visual Studio Express. At the time of writing, the latest version is Visual Studio Express 2010. Unfortunately, by using the free version of the IDE you are restricted with what you can do, and any programs you create cannot be commercially sold on. Regretfully, the full paid version of the IDE is not cheap, and probably not appropriate for a hobbyist, but fortunately to learn VB the free version is enough. In practice, very few commercial programs are developed in VB these days, but the Visual Studio IDE allows you to use many other languages. The familiarity you will develop by using it will also allow you to use the power of the IDE for development in many other languages. Some will argue that almost every language can be developed in a text editor and that they are by far the most flexible way in which to code. While this is technically true (and I do suggest trying development in a text editor to compare once you get a little better), I would strongly advise learning your first language with a proper IDE.
While traditionally, people learn Python or VB first and these are generally what is taught at schools, I would not suggest either of these. I am of the opinion that your first language should continue to be useful to you one it has served the purpose of helping you learn the fundamentals of programming. If I had to recommend one of these for newcomers, it would be VB.NET as often the most complex part of programming is the graphical side of things and in VB.NET this is very simple due to the drag and drop interface. These two languages are often used as introductions as they are very tolerant of mistakes, and allow you to become confident in programming principles without worrying about a lot of the more complex matters.

No comments:

Post a Comment