Learning to program 1 – looking for a language

I have wanted to learn how to program for years, but I never got around to actually doing it. In this 3-part series, I’ll take you through the trials and tribulations of programming as a novice.

My goal: to create and publish an app. I’m not trying to create a particularly memorable piece of software or make the next Minecraft, but if I manage to create something original and usable, I’ll consider it a success! In this 1st episode, I’ll go through the basics: choosing your first programming language.

In search of my first language

Finding the perfect programming language can be a challenge. There are hundreds of them. And just like other languages, some are really popular, while others are only ‘spoken’ in certain circles.

Computer programming language manuals in a bookshop (source)

Every language has its own tricks, tools, manuals, and gurus. Most programmers have a favorite language for their own projects, but its rarely the same one they recommend to beginners.

I want to learn how to program straight away, and I’ve started thinking about what I want from a programming language and which ones can give me exactly what I need.

Why not just one language?

All programming languages, just like any other language, have their own idiosyncrasies and history. With a bit of effort, you can pretty much do everything in any language, but not necessarily in the same way, or as easily.

Map showing the links between programming languages (source)

But think of it this way: although Sanskrit and Georgian, for example, are beautiful languages, I wouldn’t dedicate my life to learning them because they aren’t particularly useful. The same can be said about some programming: I wouldn’t devote my time to learning obscure programming languages which are only used in universities or banks.

So, what does the “ideal” language look like?

It’s pointless asking what programming language is the most difficult. A computer programming language can certainly be complex, but that doesn’t necessarily mean that it’s difficult.

Yes, a programming language may be difficult to read, or have fewer learning resources, or even a relatively underdeveloped community. Objectively, these factors all present obstacles.

In terms of learning, I’d be more inclined to use a language if…

  • It is well documented, commonly used, and has a decent set of resources
  • Its syntax is clear and easy to understand
  • It allows for immediate results
  • It can be used for almost anything
  • It allows for various programming styles
  • It can be used alongside other languages

Documented, commonly used, and has a decent set of resources

A programming language can be pretty awesome, but if it doesn’t have quality documentation, isn’t supported by decent tools, and doesn’t have an active community of participating users, it will be much more difficult to learn.

Documentation doesn’t just refer to the official help pages: it also refers to manuals and tutorials by teachers and programmers. Are there any books on the language? Good. Are they free and downloadable in digital form? Even better.

In terms of tools, you should check if they can be downloaded for free, whether or not they are compatible with all systems, what development environments are available, and if there are any interactive learning resources, like games or web applications.

Language popularity in 2010. In the top right-hand corner, you can see the most popular (source)

The community is the most complicated thing to evaluate. It really depends on personal preference. A community might be sizeable, but reasonably inactive or unwelcoming. Or it might simply be uninterested in “spreading the word”.

Its syntax is clear and easy to understand

A way of grouping different programming languages together is by looking at their level of abstraction. In other words, to what extent do they look like a normal written language?

“Low” level abstraction refers to a language which is closer to the machine’s language and instructions, meaning it’s difficult to read. “High” level abstraction is closer to human language.

The words “Hello, world” programmed in Assembler and Pascal; notice the difference in complexity

If a novice wants to learn a programming language, it needs to be very easily understood, just like other languages. Thankfully, English is the default language used all over the world for programming instructions.

It allows for immediate results

It’s generally easier to learn by doing rather than reading: you can fill your head with theory, but if you can’t put your knowledge to use with some tangible result, you won’t remember what you’ve learned.

It’s also easier to learn an interpreted programming language, where the code is executed as soon as you write it, than a compiled language, where you write code and create an executable. The difference is a question of immediacy: you can learn something and immediately try it out.

Compiled vs. interpreted programming languages (source)

If it’s written in interpreted language, the program runs slower, but it has other properties which make it interesting: it works independently from the operating system you’re using; its code is easy to correct; and you don’t have to worry too much about the hardware.

There’s another reason why interpreted language is easier for beginners: its source code is legible. Compiled programs can’t be inspected to look for ideas or to learn how they work (unless you do some reverse engineering).

You can use it for (almost) anything

There are languages which are marvelous for specific things, like math (MATLAB), drawing (Logo), database management (SQL) or audio synthesis (CSound). Within their field, they’re awesome, but they’re pretty much useless for anything else.

Although Logo can be used for many things, it’s best at drawing (source)

I think that general purpose programming languages, like Java, C or Python, are more suitable for novices because they don’t confine you to a specific domain. The abstraction of languages such as these are ideal for getting to grips with the basics of programming.

That’s not to say that general purpose languages are better than other languages for specific uses. In fact, some people are questioning whether they will still be the most popular languages in a few years time, given their function for specific purposes.

I think it is possible to learn programming using a specific language, but it’s too restrictive. Note, ‘specific’ doesn’t only refer to the application field, but to other things that we’ve already mentioned, such as style.

It allows various programming styles

In programming, the paradigm is the style or way in which the code is written. These days, we talk about four principal paradigms: imperative, functional, logical and object-oriented. Don’t panic though; they’re easy concepts to grasp.

  • Imperative: one command followed by another, like in a recipe
  • Functional: you enter data and it gives you results, like on a calculator
  • Logical: you define the problem (what you want), not how to resolve it
  • Object-oriented: data and methods are in objects, much like LEGO

The debates around which of these paradigms is the best are passionate and endless. In my opinion, they don’t make much sense, since a given style might be better for some things but not for others, and once you’re an experienced programmer, it doesn’t really matter anymore.

The four main paradigms and their languages (source)

To avoid any problems, the best thing to do is to learn a language which allows more than one programming style. And there are those that do. Many modern languages are multi-paradigm, so they allow more than one programming paradigm.

It can be used alongside other languages

Programming languages weren’t created in a vacuum:most of them are derivatives of the first languages, and many can be grouped into different families. Nearly all of them were created with the aim to overcome the limitations of its predecessors.

A section of the impressive map of the evolution of programming languages (source)

Many modern languages share characteristics with various different families. So, for example, Ruby is influenced by C++, Perl, Smalltalk and Ada, while C#’s relatives are the famous Java and Pascal.

The similarities between languages makes learning them a bit easier, since many of the resources can be shared. And since you can easily switch between languages, it gives extra motivation to those who want to learn how to program.

A quick comparison of Java and Python; there are similarities (source)

Finally, when talking about the links between languages, I don’t just mean the similarities. A good general purpose language can act as a “glue” to join together code written in other languages. It’s practical and useful!

The languages I’ve ruled out

Taking into account the criteria I’ve mentioned above, we can rule out some languages. I realize I might make some life-long enemies here, so let me be clear: this is a personal and biased selection.

The languages that fell at the first hurdle were the hundreds of uncommon languages, the low level ones, ones that were difficult to read or simply too hard for a beginner (assembly language, C++). In expert hands they can be awesome, but they’re not suitable (at least in my opinion) for novices.

Then, I ruled out those which were too specific (R, MATLAB, Scratch) and also some others which, although they’re really interesting, don’t have enough resources for total beginner, or simply weren’t popular enough (Go, D, Lua).

Popular and interesting languages like Visual Basic .NET and C# almost made the cut, but in the end I decided not to include them here because of their dependence on the Microsoft ecosystem, .NET and Visual Studio. I wanted more freedom.

I thought hard about including  C and PHP. With C, I found myself faced with an extremely important, yet compiled language, making it difficult to read. With PHP, I could see that it was also an extremely important language, but one which is pretty much exclusively used in web development.

All of them are fantastic languages, but they didn’t make the cut. In the end, I was left with the following five languages.

The top five candidates

These are the languages which, in my opinion, are the most suitable for quick, modern and easy learning, not to mention that some of them are very popular and much sought after in the job market.

Ruby, the gem from Japan

Ruby is the tenth most popular programming language in the world (TIOBE data, August 2013). It’s a general purpose interpreted language from the same family as Perl, Lisp and Eiffel, and it allows for various programming paradigms (functional, imperative, and object-oriented).

These days, the language, created in Japan to overcome the limitations of Python and Perl, is used for everything – from web programming to scripting – in any of the many operating systems it can be used in.

Free resources for learning Ruby:

Python, the Google protégé

Python is the 8th most popular programming language (TIOBE data, August 2013). It’s interpreted and is compatible with various paradigms (object-oriented, imperative, and functional), with a special emphasis on legibility. These days, Python is one of the most widely used languages in universities and learning centers, and is also used by Google and Yahoo!. It’s interpreter is shipped with the majority of Linux distributions.

Free resources for learning Python:

JavaScript, the engine of Web 2.0

JavaScript is the 9th most popular programming language (TIOBE data, August 2013). Omnipresent in modern web pages, it’s a derivative of Scheme and C, but it has its own syntax, is multi-paradigm and is interpreted.You may recall what I said earlier about learning languages that are too specific. Yes, JavaScript is fundamentally a web language, but it’s used for an increasingly large number of things, and there are many learning resources available.

Free resources for learning JavaScript:

Java, the object-oriented classic

Java is the most popular programming language (TIOBE data, August 2013). It’s a classic object-oriented program, and although it’s criticized by some, it’s one of the most frequently used languages in teaching. Its community is enormous and its documentation is endless. If you want to learn about object-oriented programming, you can’t beat it.  Although Java might not be the coolest language to use these days, you can do anything with it, like Minecraft, for example.

Free resources for learning to use Java:

Perl, the adhesive tape

Perl is the 11th most popular programming language (TIOBE data, August 2013). It has been defined as “a Swiss army knife” and is an essential language for system administration. Its syntax is incredibly flexible and tolerant (you can even write poetry with it) and its pragmatic nature means that Perl is one a favorites among beginners. Its enormous community communicates through CPAN.

Free resources for learning Perl:

Decision time

If I want to learn how to program, I have to get started as quickly as possible, and that means I have to choose my first programming language. It’s really hard to decide whose opinion I should listen to. Maybe you can help me…

What programming language should I start with?

Original article written by Fabrizio Ferri-Benedetti on Softonic ES.

Loading comments