If you are like the thousands of people each year who have decided to study computer science, or have decided to learn how to code, then you have definitely faced this question: Which programming language should I learn first? In a sea of roughly 700 different programming languages, it’s already amazing that we can narrow down the list to two — Python and Ruby. But, which one should you pick?
In this article I will discuss some of the key differences between the popular programming languages, Python and Ruby. I will also give my opinion about which language is a better choice for new programmers looking to learn their first programming language.
Python and Ruby are both general purpose, high-level, scripting languages. This means that they lack the need to be compiled like languages such as C and C++, and are passed through an interpreter instead. As such, Python and Ruby are easier to learn and interact with than other languages, making them great choices for programing languages.
Python was created in 1991 by a Dutch mathematician named Guido van Rossum. Despite being a general purpose language, Python is primarily used for academia, AI, machine learning, and data heavy programming. Ruby was created in 1996 by a Japanese computer scientist named Yukihiro Matsumoto. While also being a general purpose language, Ruby is primarily used for web development and functional programming.
Typically, programming languages are designed with some sort of philosophy or ideals in mind.
Python is built on the principles laid out in The Zen of Python. Programming in Python focuses on readability and explicitness to insure that code is easy to follow from one developer to the next. Because of this transparency, code written in Python tends to be relatively easier to debug than code in other languages. Python tries to highlight simplicity by ensuring that there should be only one way of solving a problem. Therefore, Python offers little flexibility in how code is written and is more rigid in how programmers should solve problems.
Ruby’s philosophy is built around the human element of coding. Ruby was designed with the idea of using computers to work for humans rather than the other way around. As such, Ruby code often resembles human language. Because Ruby is centered around the human experience, it is very flexible in how problems should be solved. Ruby offers tremendous flexibility between developers since there is no right way of doing something in Ruby. Because of Ruby’s emphasis on human interaction, it isn’t very explicit like Python; because of this and it’s flexibility, code in Ruby can be very difficult to debug. Where as in Python it is very clear how code flows from one line to the next, Ruby has many things happening behind the scenes — think Ruby Magic!
It is difficult to discuss Python and Ruby without discussing frameworks. Frameworks are software used to help developers create other software or applications. It can be thought of as pre-made code or tools used by developers when creating their own applications.
Python has many frameworks such as Django, Flask, CherryPy, of which Django is the most popular. Django is a web framework that supports MVC (models, views, controllers) programming. It is known for being scalable and is very compatible with different databases and operating systems.
Ruby is known primarily for its web framework, Ruby on Rails (RoR). Ruby on Rails is a great framework for web development as it is known for its speed in the development process. RoR is also known for its community and resources such as its extensive docs, and tutorial videos. Lastly, there are many Ruby Gems available for Rails that allows quick and easy customization of web applications.
Ruby on Rails Guides
Getting Started with Rails Everything you need to know to install Rails and create your first application. Active…
When learning to code, it is essential to choose a language with a large community behind it. This will ensure many answers to questions you may have, as well as continuous innovation and development of the language.
Since Python is an open source language, many people are constantly and consistently collaborating on new projects as well as innovating Python as we know it. Due to its constant transformations, the Python community is constantly shaping the direction that the language goes in — and you can too! Also, since Python is used in a broad array of disciplines and its popularity is on a steady increase, the Python community is ever growing. As such, programmers of Python can often find extensive resources to help them with their latest projects. Furthermore, with such a large community, libraries are always being updated and added, giving developers increasingly powerful tools to work with.
Like Python, Ruby is also an open source language, implying that it also has a large community behind it. However, due to its decline in popularity during recent years, the Ruby community is not as large as the Python community. Typically when talking about programming in Ruby it is in the context of Rails, so, both communities are talked about interchangeably. The Rails community, albeit slower than the Python community, is constantly innovating Ruby on Rails and is actively shaping the direction that Rails moves towards. New gems are always being added and updated which continues to push Rails forward compared to other frameworks.
When deciding which language to learn first, I am sure many people think about the possible career prospects.
As Python’s popularity in recent years has skyrocketed, so has its job opportunities. When Python is searched on LinkedIn, roughly 130,000 job listings are returned. These jobs range from data engineering, to web development. Python is extremely versatile as are the jobs requiring knowledge of Python. Still, many of the jobs seem to lean more towards roles involving data, due to the powerful libraries at Python developers’ disposal. Furthermore, according to Glassdoor, the average Python developer earns $85,634 annually, which may be understated when compared to the $103,807 average for software engineers. Some top companies using Python include: Google, Facebook, Spotify, Dropbox, and Netflix.
Unlike Python, Ruby’s popularity has been on a slow decline in the recent years. As such, job opportunities have also been on a decline, however, there are still many companies hiring Ruby developers. When Ruby is searched on LinkedIn, roughly 25,000 job listings are returned. Most of these positions are for Ruby on Rails developers and full stack engineer positions. According to Glassdoor, the average Ruby developer earns $78,878 annually, which again may be understated when compared to the $103,807 average for software engineers. Some top companies using Ruby include: Airbnb, Bloomberg, Github, and Yellow Pages.
Which to Choose?
Both Python and Ruby are excellent first languages to learn. However, if you have your mind set on working for a company that you know is actively using Ruby, then I would say to choose Ruby. In all other cases, I think that Python is the clear winner. Python definitely has a much smaller learning curve than Ruby due to its easy syntax and explicit nature. Also, learning Python well will more easily enable you to switch between languages as it is more applicable to different fields. While both Ruby and Python can be used for most basic programming, Python is more applicable and is currently more widely used. For these reasons, I think Python would be your best choice when choosing your first programming language.
At the end of the day, it does not really matter which language you decide to learn first. What is important, is that you choose a language and stick with it. All programming languages require time and dedication. You should aim to develop an intimate relationship with whichever language you do choose. If you learn one language well, paired with an understanding of computer science fundamentals, you should be able to apply your skills throughout the computer science world.
I’ll leave you with the best advice that a software engineer gave me when I was considering learning to code: “Just pick one, start, and don’t look back.”