Best programming language to start off?

20 November 2019
Tags: learning

I start off by saying it depends to make things clear. It depends on the prospect you have about what you are going to use programming for. Some factors to consider are for example:

  • do you want to create a career out of programming or is it going to be just a hobby

  • are you seeing yourself programming in the long-term or just short-term

  • do you need a quick introduction to get you started soon or are you willing to dedicate more time to understand the craft more deeply

Based on the aforementioned points I would propose the following suggestions.

Python

This is going to apply for perhaps the majority of the people willing to learn to program. The reason for this is that many of these people are likely to not start a career as software developers, while they will need to program for other applications. Nowadays anyone doing anything related to science or statistics is going to need to use scientific langauges such as Matlab, R or Python. Another reason why Python is a good choice for beginners is the simple, concise and terse syntax coupled with it being high-level which allows the developer to forego details which afflict other languages (e.g. low-level operations for C-like languages or OO syntax for Java-like languages). You can write Python code straight away in just few lines of code without any unnecessary boilerplate. The language is powerful enough though, and allows you to exploit additional paradigms and approaches to make the code more complex.

Javascript

This is also going to be one of the most popular choices, in particular for those people willing to make a career out of writing software. Most software development jobs are web and Javascript is king in the web. In the last decade it has risen in prominence like no other language. What makes this language suited to new developers is also the fact that it is still mainly used for front-end development, which is usually less geeky and techy than other kinds of development roles. This results in a more vibrant and heterogenous community, which I think is a strong point in favor. As the language per se, however, I don’t consider it to be the optimal choice, since the plain lanaguage is far from being straightforward and consistent. Many of its quirks confuse even the most seasoned Javascript developers. And it requires a thorough understanding of many of its mechanisms to properly master the language; I think it is one of the most deceiving langauges in that it seems to be simpler than it actually is (for a further understanding of the language I advise Kyle Simpson’s books [1]). Moreover, nowadays the ecosystem which revolves around it is daunting, and it is likely you will immediately be faced with several other technologies when working with Javascript.

C

I think C language might be the best choice if you plan to get a thorough foundation of programming, since it is lower level than most languages out there. You are going to do things such as manually dealing with memory yourself, which is complex and requires a lot of experience and good thinking. It however gives you a glipmse of how things work are managed down there while other languages provide an abstraction on top of it. It is also a procedural language, which means that you are not going to deal with any object-oriented or functional concept making it easier to focus on the essence of programming.

Scheme

This could be a great choice if you want to get exposed to the functional and declarative thinking early on in your journey. I don’t know how this actually affects the mind and the approach since my first langauge was C. The different syntax and approach on programming of Scheme, which are fairly different from most other languages, may make the transition to any other language more difficult at the beginning. However, Scheme can be a great choice as it allows you to learn Lisp (defined the most powerful language of all [2] [3]) devoid of any other pre-concept from other langauges. Another great point in favor of this choice, is that Structure and Interpretation of Computer Programs [4] has been written in this language.

Haskell ?

I am not sure about this choice, but Haskell could also be a valid alternative if you plan on learning the functional approach with a pure functional language. Also I find it very concise, which is good when you are starting out so that you don’t get distracted by unnecessary syntactic details. The problem with it could be that it quickly escalates into category theory (monads and all its friends) as soon as you want to do something more useful such as reading/writing or dealing with uncertain operations, which may be fairly confusing, especially for the not so mathematically well-versed audience. It could be a good fit for mathematicians though.

What is not a good choice

There are some language which I consider not to be a good choice as first language to learn programming.

Java

Java is deeply object-oriented flavored, in that even the usual Hello World program requires you to set up a class and a method. It is also highly verbose, which may be distracting if you plan on learning the essence of the logic behind programming. I believe Java is a good choice if you want to learn object-oriented programming (in a statically-typed language), but I personally think the object-oriented paradigm should be learned after learning the procedural one with C or Python or the functional with Scheme

C++

I would say C is by no means the best way to start learning programming, as it is notoriously over-complicated and is huge. C would definitely be a better choice since it is just a small subset of C. C++ could be the natural continuation after learning C if you plan to use it for your applications (e.g. embedded, video-games, graphics).