Home > Learning To Code > Learn To Program 1: What It Takes

Learn To Program 1: What It Takes

I want to learn to program. What language should I start with?

This really depends on what your goals are, and whether you just want to dabble for fun as a hobby at home, or have a desire to become a professional software developer.

If your main interest is in making your own web pages, HTML (the language used to control the format and layout of web pages) is a perfectly good place to start.

If you love World of Warcraft and want to write your own plug-ins, but don’t much care about other types of programming, there is no reason why you shouldn’t start by learning Lua (the language used for World of Warcraft scripting).

If, however, you either want to be a professional, or have no specific specialist interests yet, I feel that the best approach is to learn a general programming language (such as Basic or C++). The skills and concepts you learn when you learn a general programming language are highly transferable to other languages. While learning HTML or Lua well might make you good at one specific set of tasks, learning a general language will give you the tools and techniques you need to turn your hand to many other things later on.

When you learn a language that has been created with a specific goal in mind – such as HTML – you will focus on learning to use the language to get a certain job done. However, when you learn a general language as your first foray into programming, the focus is more on the concepts and techniques you will learn to solve generic problems, rather than the nuances of that particular language itself. Once you have mastered these techniques, learning other languages – especially marginally specialized derivative languages such as Java and PHP – will come much more easily (Java and PHP are also general languages, however unlike something like C++, they tend to be used in specific contexts – Java for portable desktop applications and web applets that run in the browser on the user’s computer, and PHP for the behaviour of dynamic web sites).

So which general language would you recommend I start with?

There are numerous choices, and there is no right or wrong answer. There are two main routes you can take though: languages with a simple syntax (way of writing the code) that are easy to learn, or languages with a harder syntax but that have more power and more immediate applicability in real-world programming.

Whether applicability to the real world matters to you depends on why you are learning to program. For making fun little programs at home, Visual Basic or Pascal are simple to learn and easy to use. Languages like C, C++ and C# are more powerful and trickier to learn, but industry demand for people who know these languages is much higher, and their syntax is very similar to other languages such as Java and PHP, which makes transferring your skills easier later if you decide to enter these areas of programming.

All things being equal, and when the newcomer has no direction in mind, I prefer to teach C++. It is not exactly the simplest thing to start with, but I prefer it as a teaching tool for these reasons (this list is aimed at teachers and cirriculum-setters; if you are looking to learn to program, do not worry if you do not understand this!):

  • It is the most widely used general programming language of today
  • Together with C it is more or less the only non-assembler language that can, if desired, give direct and complete control over the machine
  • It contains all of the language elements needed to teach all of the required techniques and skills for general programming
  • The “complicated” C-specific features (pointers, templates, multiple inheritance etc.) do not necessarily need to be taught at all, but are available if the student is proficient and wants to delve deeper
  • Some quirks aside, it is a reasonably good and powerful implementation of object-oriented programming (OOP), which makes it a good choice for teaching OOP. But the object-oriented side can still be ignored altogether and only procedural programming taught if desired.
  • C++ is portable, and has equal applicability to Windows, Linux, Mac, games consoles and embedded devices.
  • If the student can program in C++, they can program in C with only minor transitional learning.
  • C++ is a compiled language rather than an interpreted language, which allows the concepts of compilation, linking, object code and so on to be taught.
  • C++ does not rely on a VM (virtual machine) like C# and Java, or a proprietary set of libraries or APIs.
  • C++ shares its fundamental syntax with C, C#, Java, PHP and many other languages.
  • Programmers must also learn to use the development tools. The IDEs (Integrated Development Environments) for C++ such as Visual Studio are adopted industry-wide standards. Visual Studio is in addition used for many other types of development work.

Learning C++ as a first language has some disadvantages:

  • It is one of the more complex general programming languages
  • The syntax can be confusing for newcomers
  • Even the free IDEs like Eclipse and Visual C++ Express are ridiculously over-complicated when working with simple projects, and can be overwhelming for beginners (C++ is not the only language whose tools suffer from this problem, but it is one of the more extreme cases)
  • Most programs made by beginning programmers will run in the console (command prompt / shell) and won’t give the instant gratification of having made a recognizably useful or ‘cool’ program.

Even with these caveats, I feel that C++ is probably the best choice of general language to learn when starting from scratch.


Pages: 1 2 3 4

  1. mau
    October 4, 2012 at 02:09

    This is a very nice post, even for a programmer like myself :p
    I was looking for your WMI cleaning but it seems either the link is broken (http://www.djkaty.com/wmicorruption redirected me here) or the post doesn’t exist anymore.

  1. May 15, 2012 at 10:03

Share your thoughts! Note: to post source code, enclose it in [code lang=...] [/code] tags. Valid values for 'lang' are cpp, csharp, xml, javascript, php etc. To post compiler errors or other text that is best read monospaced, use 'text' as the value for lang.

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

WordPress.com Logo

You are commenting using your WordPress.com 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: