Top Programming Languages Newbies Should Get Acquainted With

Posted on - Last Modified on

We're now living in a time that's considered as the next era of industrial revolution, but not in the same way that we know from the history books. Computer science, programming, and software development in general ignited this new revolution, and great startup companies like Facebook and Google are fully supporting campaigns – such as Hour of Code and Code.org – to fuel it by introducing people to computer science and the basics of programming. Modern society is now starting to understand that computer science and informatics should be part of the basic learning materials for children, and how it can help them progress.

Think of how children in the Netherlands learn about finance. They're taught the basics from an early age, are aware of stocks and commodities, are familiar with income and expenses, and know what hedging is by the time they reach high school. This information helps them to plan their financial future and will most probably do better financially in life.

In my opinion, all the people who have not learned programming should at least go through a minimal programming course, and this is not because I am fanatic. Programming will help people learn how to break down problems and build up a step-by-step solution to resolve them. This will develop analytical thinking and helps them see the connections between different problems or solutions.

In this article, I present the three basic programming languages that I consider to be good for people who want to start learning programming. All of the three languages are dynamic programming languages, which are good starter languages because newbies don’t have to understand the in-depth meaning of types from the beginning.

Python

The Python programming language appeared in 1991. While it's been around for 25 years, it is still one of the most widely adopted programming languages in the world. Python does have an interpreter that can be used to play with the language. Python is usually installed by default on Linux systems, but if not, it can be installed through well-known package managers, like APT under Ubuntu:

sudo apt-get install python

Another reason why Python is good for learning programming is because it uses indentation to separate code blocks. There is no additional characters to use for code block separation, like in C or C# or Java, and this also forces the developer to always indent and format the code correctly, otherwise the behavior is not the expected one.  Now let’s see some code examples that show off the features of Python that make it easy to use for new developers.

Hello World in Python

Every programming tutorial starts with the traditional Hello, World! Application. When you are using Python, this is a one-liner:

print("Hello, World!")

Conditionals in Python

The conditional statements’ format in Python are easily readable. In the function below, we check if the number given as parameter is an even number or not:

def is_even(number):
    """
        Checks if a number is even or not
    """
    if number % 2 == 0 and number > 0:
        return True
    else:
        return False

Here's another great example of conditions, which is readable:

def my_name_contains(letter, name):
    if letter in name:
        return True
    else:
        return False


if __name__ == '__main__':
    if my_name_contains("g", "Greg") and my_name_contains(("r", "Greg"):
        print("Yes it does, grrr!")
    else:
        print("Nope, wrong letter!")

Here, the two if statements are the important part. The first if in my_name_contains function checks if the name variable has the letter given in parameter. The second if can be read out loud like text – if my name contains g and my name contains r then print a message. Since Python is a dynamic language the assignments below are valid:

    test_var = "John";
    test_var = 123;
    test_var = [1, 2, 3, 4];
    print(test_var); # will print [1, 2, 3, 4]

Another good example of easily readable code is the for loop:

for number in range(15):
        print(number)

dictionary = {"Name": "John",
              "Address": "No Address Available...",
              "City": "Chicago",
              "PhoneNumber": "123-123-123"}
for key, val in dictionary.iteritems():
        print("{0} has value of {1}".format(key, val))

The first for loop prints the numbers from 0 till 14. The we defines a dictionary; this is like an associative array within Python. The dictionary holds key-value pairs. In our example, the keys are: Name, Address, City and PhoneNumber. In the second for loop we go through the keys and values at the same time, this way within the inner part of the loop we can print to the console every element in the dictionary. In Python’s website there is a good tutorial for learning Python programming. Here you can find a tutorial for the strategic game, Civilization IV.

There are some well-known frameworks which were developed using Python, like the Flask Web development framework or Django, the Web framework for perfectionists.

Ruby

Ruby is another dynamic programming language that was released in 1995. Ruby was influenced by many programming languages, including Python. The two languages have some similarities but do have some notable differences such as with the until loop:

vacation_left = 7;

until vacation_left == 0
    puts "Yipeee I still have some vacation to take out"
    vacation_left -= 1
end

For example, the code above will output “Yipeee I still have vacation to take out” seven times then it will stop the execution. Ruby has arrays, while Python has lists.

<pre class="brush:ruby;toolbar:false;">names = ["Jane", "John", "Bill", "Yoko", "Fred", "Emma"]

for name in names
    puts name
end</pre>

In this code, we declare an array of strings, and the declaration is the same as in the case of Python’s Lists. After the array, we have a for loop, which iterates over the array and writes the names to the console. Please note that another difference between Python and Ruby is the end keyword. In Ruby, the loops and conditionals have to have an end statement at the end of the implemented logic. You can define hashes – these are the same as dictionaries in Python – but the creation syntax is a little different:

john_doe = { :firstName => "John", :lastName =>"doe", :job => "software engineer", :birthdate => Date.new(1983, 3, 5) }

for key, val in john_doe
    puts "#{key} has a value of #{val}"
end

In Ruby, the dictionary keys are marked with a : (colon), and the values can be any object.

There is also an interesting difference between Python and Ruby in conditionals—while Python has the elif keyword, Ruby has the elsif keyword. Here is an example of Ruby’s conditional statements:

if john_doe[:job] == "software engineer"
    puts "he is awesome"
elsif order[:job] == "blogger"
    puts "he is not a software engineer, but a blogger"
else
    puts "I do not know what is his job but I am sure its good :)"
end
Another nice feature of Ruby is the unless statement. This can be used in cases when you would need to check the negation of some value in an if statement. For example, when you write software for an alarm system, you may have this valid code in any C based language:
if (!is_somebody_home) {
    setAlarm();
}

If we read this out loudly it sounds like if not is somebody at home, which is not very intuitive and easy to understand. In Ruby, we can use the unless statement:

unless is_somebody_home
   setAlarm;

Besides being easy to learn, Ruby is an interesting language with many nice features for programmers, and coding in Ruby can be fun.  Ruby also has a widely adopted Web framework, called RoR, Ruby on Rails.

JavaScript

JavaScript is the third on my list, because it is so widely adopted and recognized as the future language of Web development. I assume everybody who starts programming wants to learn a little Web development and for that JavaScript is a must. Besides that, now you can develop the backend and frontend of your applications using only one language, JavaScript. JavaScript is a dynamic programming language too, like Python and Ruby.

JavaScript has a C-like syntax, since it was inspired from Java. For example, creating arrays can be done the same way as in Ruby:

numbers = [1, 2, 3, 4, 5, 6, 7];
for (var number in numbers) {
   console.log(number);
}

This code creates a new array with numbers from 1 to 7 and then logs these numbers to the console. The conditionals on JavaScript side look very much like in any C-like language, with if/else if/else constructs.

if (numbers.length > 7) {
    console.log(numbers[7]);
}
else if (numbers.length == 7) {
   console.log(numbers[6]);
}
else {
   console.log(numbers[numbers.length - 1]);
}

The dictionaries within JavaScript can be the JSON objects themselves:

var johnDoe = {
    "firstName": "John",
    "lastName": "Doe",
    "birthDate": new Date(1983, 3, 5)
};

console.log(john_doe["lastName"]);
console.log(john_doe.firstName);

In this code example, we create a new JavaScript object with firstName, lastName and birthDate properties. JSON values can be accessed in two ways: using the index operator and specifying the key or trying to access the value directly on the object.

The advantage of learning JavaScript is that you get familiar with C-like syntax and then when you learn another programming language such as Java or C# or even C, the syntax should already be familiar.

There are many Web frameworks that are based on JavaScript, maybe one of the widely known ones are jQuery, Angular.js, Ember.js and React.js. On the server side, we have Node.js with a lot of extensions and useful frameworks.

Those new to code will find these three languages useful – Python because of its simplicity, Ruby because it's fun (and was influenced by Python), and JavaScript because it could very well be the future of Web and application development.

If you have other suggestions on which languages newbies should learn first, please leave a comment and share your thoughts!

Posted 3 March, 2016

Greg Bogdan

Software Engineer, Blogger, Tech Enthusiast

I am a Software Engineer with over 7 years of experience in different domains(ERP, Financial Products and Alerting Systems). My main expertise is .NET, Java, Python and JavaScript. I like technical writing and have good experience in creating tutorials and how to technical articles. I am passionate about technology and I love what I do and I always intend to 100% fulfill the project which I am ...

Next Article

Social Media for Recruitment: Hiring Techniques to Consider