Introduction
When we start to learn your first programming language, we have many questions like how to start your first programming language and what we need to start your programming language and what language is better to start. 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.
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 online, 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.
For those brave souls among you, I would actually suggest Java as your first language, even though it can be complex, and is therefore not a common choice for a first language. Java programs are different from most others in that they do not run on your computer. The user downloads Java, then your code runs on what is called a VM (Virtual Machine). This means that your code runs in a special place Java sets up for it – a fake copy of your computer – and handles the translation of this to the real machine for you. This means that Java programs are “cross-platform”, meaning that they will, for the most part, run on Windows, Mac, Linux, and most other operating systems.
Java is a good language to learn, as it is very widespread and useful. Furthermore, it is very powerful and is available for free for both hobbyists and commercial uses. However, in contrast to VB and Python, it does not tolerate mistakes and requires you to be very specific about everything. It is also an object-oriented programming language, which is a very complex issue which I will briefly try to summarise. Languages like Python and VB are what is known as procedural languages, meaning that the lines of code are run one after another, whereas Java is an object-oriented language. object-oriented development is a term thrown around a lot these days in the programming world, and while not always appropriate it is generally considered a good idea. At the most basic level, an object-oriented program is all about objects. An object is an “instantiation” of a “class”. A class is a blueprint used to describe something like a cat. The class contains both the data about the cat such as its name, age and owner as well as “methods” which are essentially actions the cat can perform, such as miaow. An instance of the class “cat” would give you a particular cat. However, this is not a Java tutorial, so if you are brave enough to experiment with Java you will come across this yourself in more detail. It is worth noting that VB.NET and Python both have support for object-oriented development, and Java has the potential to be used procedurally, but these are not the languages’ primary intended uses and are not often used. If you did not understand that comparison, don’t worry about it too much. Object orientation is hard to get your head around, but any basic Java or another object-oriented language tutorial will have you understanding everything in that paragraph.
A final reason Java is a good first language is that it is similar in many ways to Javascript, which is an entirely different class of language. Javascript is a scripting language (as is Python), and learning Java will mean you understand Javascript reasonably well. The difference is between scripting languages and normal programming languages are outside the scope of this article, but as large generalization scripts are generally used for automated tasks while programs are used interactively by users. This is not totally true, as both types of language are used for both tasks and most web programs are built in Javascript.
As for the actual language you pick, it is entirely up to you. Some may choose the traditional beginner languages or be brave and experiment with Java. Some of you may already have your eye on a language or fancy one of the more specialist languages like Scheme or Prolog. Whatever your choice, the way you will learn how to program is the same.
What IDEs ( Integrated Development Environment ) is best?
Many of the purists say that IDEs are a bad idea, and are packed with unnecessary tools and menus that take up disk space and time to learn. While this is true, I feel that an IDE is definitely worthwhile. Many people offer free IDEs, such as Eclipse and Netbeans, for the more popular languages. There is also Visual Studio, which I mentioned previously; it is very intuitive, very powerful and it supports many languages (much as Netbeans and Eclipse do). If you chose to use Java I would suggest Netbeans, as there is a packaged version of Netbeans with the JDK (Java Development Kit). Most languages need an SDK (Software Development Kit) to work with them, and getting it installed properly and linked to the IDE is often the hardest part of the procedure. Visual Studio already comes with the development kits set up, which makes life easier, but other languages like Java and Python can be quite hard to set up properly. This is why I suggested the Netbeans + JDK bundle for those experimenting with Java, as it handles the complex set up for you, which will save you hours of suffering.
There are, in my opinion, three major advantages to using a fully featured IDE. Firstly, they are usually extensible, meaning that there are many free plug-ins that could make your life a lot easier when you get a little more advanced. Secondly, and most importantly, is the ease with which an IDE allows you to debug your code. Most IDEs let you set breakpoints in the code, which will make the program stop when it gets to that point and let you step through it line by line so you can examine the contents of all the variables at any time. (For those of you who do not know what a variable is, I will briefly explain. A variable is a bit like a train station locker. You ask for one big enough to hold what you want to store, and if what you want to store is the right shape, it can be stored there. When you write a program, any data you want to store temporarily will be held in one of these until you are done with it.) As the old programming saying goes, if you have not found any bugs, you are not looking hard enough. Almost no non-trivial program will work the first time, and trying to work out where the problem lies without the use of a debugger is a pain I would not wish on anyone. Finally, an IDE will often give you advice on how to fix issues in the code. This can be very useful for fixing bugs and saves you having to resort to Google every other minute.
Learning Another Language
Once you have learned one language, whatever it may be, the most valuable thing you will have learned is all the keywords for searches. When you want to do something in a new language, you need only search for what you want to do and the language name. However, by now you will know the names used to refer to what you want to do, allowing your searches to be more effective and yield examples and answers much more quickly. As the fundamentals of programming are mostly the same, regardless of the language you use, you will hopefully be able to guess at the meaning of most of the code much more effectively once you locate an example, allowing you to pick up most of the language very quickly indeed.
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 is 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 favorite 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 practices some more.
Practice makes a man perfect