Ruby vs. Python
Prior to starting my coding bootcamp, every one my friends with experience in software engineering asked me about the Flatiron curriculum and what languages they would be teaching us. I would explain, with little familiarity, that we would cover ruby, rails, JS, and react. In every conversation, the same thing would come up — “ what about python and django?” It came up so often, I was genuinely concerned I wasn’t going to be effectively utilizing my time. Once the bootcamp started, I would frequently ask my colleagues and mentors about python and if this was a language that we should pick up once the program was over. Sensing my anxiety, these kind souls assured me that python and ruby are similar. A practitioner of one could easily pick up the other. With that said, I was and still am extremely interested in how similar these languages are.
I’ve spent a decent amount of time with ruby (the last several months), familiarizing myself with its behavior. I wanted to take this opportunity to explore the differences between these two languages further.
Please note that it would be kind to call me novice or junior-level anything at this point. My experience level in programming is low and this article will most likely reflect that. Also note, I will not be getting into too many of the granular differences. There are much smarter people that have done a good job of covering these things already (I link to them in this post).This is more so a comparison on a macro level.
Similarities
- Developed in the 1990s by individual programmers
Ruby: Yukihiro “Matz” Matsumoto, 1995
Python: Guido van Rossum, 1991
- Object-oriented and dynamically-typed language.
Everything is an object in both languages and variables are references to those objects.
- Heavily focused on developer productivity and happiness (but with difference philosophical approaches to what that means — see differences)
Both emphasize DRY (Don’t Repeat Yourself) principle.
- Performance
Both are considered to be highly efficient programming languages with fast, secure, and user-friendly frameworks. Their respective web frameworks use a similar structure: MVC/MVT (Model-View-Controller/Model-View-Template).
- Scalability
Both are highly scalable, even with their “different” philosophical approaches. Python is easy to standardize. Ruby is flexible. Both are user-friendly.
- Job Market
In a general sense, strong for both languages, but python edges out ruby given its higher popularity.
- Developer Salaries
Job listings for both languages have relatively high entry-level salaries and average salaries (although ruby’s is currently a little higher).
- Dedicated (and enthusiastic) programmer communities
MINASWAN — A ruby community mantra
Differences
- Syntax
Duh. They are different languages. If you want to look at the transition from python to ruby, this documentation is a good place to start. If you are going from Ruby to Python, here is a great blog from a fellow Flatiron student. Its far more technical and specific that this article (and the information may be dated in some ways), but it certainly highlights some of the language-specific differences.
- As an introductory language
Ruby is not recommended as the first language to learn in software development. Conventional thinking is that it is so flexible, that it may be difficult for students to understand core, universal concepts within the context of extreme flexibility. I have to vehemently disagree with this in regards to my own experience. I happen to really like ruby and the freedom it gives me, but I can see how that freedom might be overwhelming for some.
Python is considered a good introductory language. This also may be what is contributing to its surge in popularity. Python for many is a great language to teach young learners and as coding is now incorporated into secondary education curriculum, its popularity certainly benefits from that. Given its already healthy presence in the software development community, python has a plethora of resources online.
- Web frameworks (but they are similarly structured — see similarities):
Ruby : Rails
Python : Django
- Popularity
Ruby: Has steadily decreased over the last several years, but remains in demand.
Python: Demand remains high with no signs of stopping.
- Targeted Use
Ruby: Web development and functional programming.
Python: Data science.
- Philosophical approaches
Ruby: There are multiple ways to approach the same thing, making it easier to develop and manipulate (that doesn’t mean that ruby developers don’t prioritize convention, because they do). Some would say that ruby is more expressive.
Python: There should be one, efficient way to do something that can be easily understood by all. Efficiency and readability are top priorities.
- Major Applications
Ruby: Basecamp, Hulu, Twitter (originally), Github, and Airbnb
Python: YouTube, Instagram, Spotify, Reddit and BitTorrent
I’m sure I have missed PLENTY in my comparison of the two, so please be kind when evaluating this article. This is coming from someone who has recently been introduced to ruby and has no experience with python. A lot of this information was collected around the internet and packaged in way that I would find useful for someone in my position.
I love working in ruby and rails, but there is obvious demand and utility in learning python. When the bootcamp is over, especially now that I have significantly improved my independent learning skills within the realm of software engineering, I plan on learning python (and django).