BTG Coding School

Q. What is the Best Programming Language for Beginners?

Many newcomers what to know which language they should learn. Since learning a programming language takes time, they want to make sure they pick the best language possible.

While there is really no perfect, the following are good starting points for beginners.

  • Javascript
  • Python
  • Lua
  • Lisp

My basics course uses Javascript. Below I’ll talk about some pros and cons for each of these languages.

If you want a quick summary, here is a tl;dr:

  • Javascript -> Good general purpose, also can run in the browser
  • Python -> Good for data analysis and AI
  • Lua -> Commonly used in game development.
  • Lisp -> Nothing to memorize, the full language can be learned in an evening. Though less popular today.

For each of the languages below, I’ve provided some example code that generates the nth term in the fibonacci sequence. This is to give a little taste for what each language feels like, but also to help illustrate how similar these languages are in practice.

Javascript

Javascript is a language that was originally created for adding scripts to webpages. Today, Javascript can run outside the web browser, and is popular for building web based services with the help of Node.Js. Several sites including Netflix and Ebay both use Javascript.

Pros

  • Fast. Since Javascript speed is critical to web browsing performance, a lot of effort has been spent making Javascript fast.
  • Wide spread: You can use Javascript in many different ways, from web sites to internet services and more.

Cons

  • Quirky. Javascript was designed for ease of use, which leads it to sometimes have surprising behavior. This can sometimes trip up beginners.
    function fibonacci(n) {
        if (n < 2) {
            return 1;
        } else {
            return fibonacci(n-1)+fibonacci(n-2);
        }
    }

Python

Python is another popular language for beginners. It is quite popular today for data analysis and AI. It is a general purpose language like Javascript, and can be used for many other purposes as well. Python uses spacing as part of the program, which can make programs easier to read.

Pros

  • Lots of mathematical libraries exist. If you are interested in learning to program to perform various forms of analysis, Python is a good fit.
  • Whitespace requirements help ensure Python code is formatted a certain way, which can make it easier for beginners to learn.

Cons

  • Most programming tools dont actually show whitespace (tabs and spaces etc), so catching issues related to poorly formatted code can sometimes be tricky.
        def fibonacci(n):
            if n < 2:
                return 1
            else:
                return fibonacci(n-1)+fibonacci(n-2)

Lua

Lua is a popular embedded language, which means it is easy for other programs to run external programs written in Lua. This has lead to widespread use for scripting in game development. Many notable games let you include Lua scripts, including World of Warcraft and Roblox.

Pros

  • For game development, it is a great fit. In addition to writing scripts for other games, it is often used for building complete games.

Cons

  • It is often harder to find libraries for Lua, since outside of gaming it is less popular than the languages mentioned above.
        function fibonacci(n)
            if (n < 2) then
                return 1
            else
                return fibonacci(n-1)+fibonacci(n-2)
            end
        end

Lisp

Lisp is not often recommended for beginners anymore, though it has many properties that make it excellent for learning. It was originally developed in the 1960s and heavily used in logic based AI programming. MIT previously taught its introductory class using Lisp, since the entire language can be taught in an evening, leaving time to focus on problem solving. Recordings from these classes are freely available online.

Pros

  • Very simple, yet powerful language.
  • Good for learning programming concepts

Cons

  • Not very popular today.
  • Very different code appearance from many other programs.
        (define (fibonacci n)
            (if (< n 2)
                1
                (+ (fibonacci (- n 1))
                   (fibonacci (- n 2)))))