Programming Language Advice to My Daughter, Part 1: Ruby
Mastering the wonderful Ruby language will get many benefits
My daughter is about to start her first IT job (internship) next week. A few days ago, we had a conversation about hype in the software industry, many so-called new technologies and programming languages. I said: “You shall master 2 major languages very well and 2 minor ones well. Two majors: Ruby and C++; Two minors: Shell Script and Java”.
Please note that I don’t classify major or minor based on popularity, but rather the benefits I got from over 20+ experience in software development. Programmers are often fixated on a particular language, I am sure you have all heard some heated arguments among programmers on this topic. Oh well, this is my advice to my daughter, if you don’t like my suggestions, close the browser tab.
Below are the programming languages I’ve learned and used. The bolded ones that I used professionally, and I get paid by writing code/tests in them.
BASIC
Pascal
C
Perl
Shell
Java
JavaScript
C++
C#
Ruby
Python
Swift
Also, I have programmed briefly in PHP, Haskell, Lisp and Go, but not much is left in my brain now.
This is not for showing off, simply means that I worked for many years as an open-minded programmer. Now I look back and ask myself:
Do I need to learn so many programming languages?
No.If I had a choice, which languages I shall have started early or focus on?
Ruby and C++ mainly; Java and Shell script as supplements.
Please note, here I mean the languages that shall master well, not directly to work use. For example, between 2008–2010, I coded Ruby to develop my apps and test automation in my spare time, which made me a much more productive Java programmer at work (as a senior Java contractor). Programming is far more than being familiar with certain language syntax. 10x (or 100x+) programmers come up with a good design quickly and code it efficiently (in a few languages), and often implement test harnesses that make sure it works as expected.
1. Ruby
Ruby is a great language, actually more than great, it is fun! Fun is important, as programming can be quite frustrating at times.
What is Ruby good for?
Object-Oriented Dynamic Language
Ruby is a pure object-oriented script (also known as dynamic) language. Commonly, young programmers lack exposure to dynamic languages, which is a pity. In my opinion, a real programmer must be comfortable with programming in both (at least one) compiled and script languages.
for Web Development
Ruby on Rails (RoR) is a well-known web framework, Github, Airbnb and many household websites are powered by RoR. David Heinemeier Hansson (DHH), the creator of RoR, likes Ruby so much that he included Ruby into the framework name (so did Watir).
for Test Automation
Ruby is the best scripting language for test automation (API, functional and non-functional), period.
Regarding language ranking, Ruby has now dropped out of the top 10 (2014: #8, 2021: #16) as the choice for coding. However, in test automation, Ruby is one of five official Selenium WebDriver language bindings, along with Java, C#, JavaScript and Python.
for Text Manipulation
Ruby is a powerful (only second to Perl, IMO) yet intuitive text-processing language. Many programmers are unaware of how useful programming knowledge of parsing and generating text is. This is one skill set that I found the use in almost every software project.
for Deployment
Ruby’s easy-to-use networking features (such as net-ssh
) make it an ideal language for deployment. The Ruby-powered deployment tool Chef is proof.
“Chef is ideal for deploying and managing the cloud server, storage, and software.” — tutorialspoint
How did I start coding in Ruby?
I heard of Ruby in 2005 from a world-class programmer Jon, whom I was so fortunate to pair-program with for 6 weeks. A few years later I learned, Jon was listed in the Java Who’s Who, i.e, top Java programmers in the world.
I learned so much from Jon: test automation (unit testing with mock, automated functional testing, Refactoring, Agile (real), Design Simple and Continuous Integration). All these are in Java language, with the exception of CI (I will explain it later).
I was so impressed with his software design and efficiency in producing high-quality code. For example, he designed one single class that replaced one layer of our classes (our former architect’s design based on IBM’s work).
During the work-together, he talked about how much he loved the Ruby language. I programmed Java since 1997 (v1.0.2), and Java was hot in the job market, so I had no strong interest in learning another language (big mistake). The fact is that everyone in the team acknowledged Jon was the best Java programmer we had seen, and he recommended Ruby.
After Jon left, I took over maintenance work for running unit and functional tests in the CI server, which was created in Ruby language by Jon and Aslak Hellesøy (the creator of Cucumber). So, I started learning Ruby.
Very soon, a strange thing happened. Even though I programmed Java for 8 years, I found myself thinking in Ruby first while coding in Java.
Later, I found the explanation from the book “From Java to Ruby — Things Every Manager Should Know” by Bruce Tate, a Java Guru. According to Bruce, Java inherited a lot of syntax from C++, which is built for system programming. For developing enterprise software (a lot simpler compared to the system), Ruby is a better option. I totally agree. And I proved it by implementing a handful of highly-acclaimed own apps in my spare time. Back in my prime days using Java, to achieve one is hard if developing using Java full-time.
I remained contracting in Java and C# for a few years. As time went on, my love for Ruby grew more. Also, I started introducing test automation to the projects. The natural choice of the framework was Watir (used at Facebook at that time as well). So I got to use Java/C# and Watir at work, for different purposes.
In 2007, I decided to create a test automation IDE for Watir. I prototyped in Java and Ruby. I chose Ruby because I only could work on this in my spare time, the development efficiency and fun took priority.
In 2009, TestWise (formerly named iTest2) was demonstrated at the Agile 2009 Conference workshop in Chicago, and a finalist of the Ruby Award 2010. Since 2012, I started developing my own web apps, including ClinicWise, SiteWise, and WhenWise, all based on the wonderful Ruby on Rails framework.
Q & A
1. I don’t want to learn Ruby as it is slow.
Yes, Ruby is slower than Java, JavaScript or C#. This does not mean Ruby is all inferior as a programming language. If someone insists on this logic, I would say Java is slower than C++, shall Java programmers dump Java? Of course not.
With hardware getting faster, development efficiency is more important. By the way, the performance of Ruby improved significantly in each major version, v1 => v2 => v3.
2. I heard Twitter dumped Ruby for Scalar because it is not scalable?
Different people have mentioned this to me a few times. This lacks common sense. Twitter was initially developed in Ruby (on Rails). Now think of the most scalable system you have implemented. I bet it is probably a tiny fraction of the early Twitter (Ruby implementation). If some are still in doubt, GitHub and Airbnb are developed in Ruby. There is never a scalability problem with Ruby, at least for 99.9999% of software projects.
One architect I worked with had the wrong scalability view for Ruby (rumours spread fast). How about the software he designed in his favourite language C#? The test server often crashed when I triggered a run of automated E2E tests in BuildWise (against the test server), with merely 3 build agents.
3. Ruby is no longer as popular as it was.
Yes, that’s a fact. I am talking about the benefits of mastering Ruby, not about finding jobs.
Whether a programming language is popular is largely decided by commercial factors.
Python existed for a long time, but only in recent years regained popularity (actually the №1) because of the hype of Machine Learning and Data Science.
(the language has not changed much in the last two decades)The early quick adoption of Java was pushed by IBM.
(according to this article in 2009, ‘Big Blue is willing to pay at least US$6.5 billion for Sun’)C# is promoted by Microsoft, of course.
Node.js became widely adopted because of Google’s AngularJS (even though it is deprecated now)
There were no big companies pushing Ruby, being low profile is a reflection of its creator: Matz. Because of Matz’s genius and his passion, he kept Ruby free from some mistakes other languages made. I had a few of my own products, I understand saying NO to commercial interests is not easy.
Dave Thomas and Andy Hunt (co-authors of Agile Manifesto and the founders of Pragmatic BookShelf) found out about Ruby by accident. They were surprised Ruby was popular only in Japan for a long time but hardly known outside the country. They read Ruby’s source code (praise highly) and wrote the famous “Programming Ruby” book, which introduced Ruby to the English-speaking world.
In 2018, I received the Ruby Award (2nd prize) from Matz in Japan. Prior to the ceremony, there was a report from the Ruby language committee (or alike), the funding is really tiny. I was surprised, Twitter, Github and Airbnb are multi-billion dollar companies, why don’t they sponsor further development of the Ruby language and promote Ruby?
Later, I found out what could be the reason. Once I talked to an independent software vendor, and his words enlightened me: “I wouldn’t say good things about Ruby to others either; This is my edge to compete with other products developed in Java/JavaScript”.
4. Despite the obvious success of Airbnb, Github, and others using Ruby on Rails, why do many companies not adopt Ruby?
First of all, there was a time that Ruby on Rails was hot in the USA. There were many articles like this “Why Ruby On Rails Developers Are Getting The Biggest Bucks In US?”
A top software-consulting company ThoughtWorks used to include Ruby on Rails as one of the enterprise tech stacks. Check out this article by Martin Fowler: Three Years of Real-World Ruby. Why did it fail? The tech leader of the ThoughtWorks Ruby division left to set up his own company: HashRocket. I remember HashRocket once offered a one-day app, i.e. they would develop a typical eBusiness app in one day. Of course, this is more or less a marketing strategy. However, in the business world, to short-sighted executives, it does not make business sense for consulting-type companies, which benefit financially by making the project longer, Ruby is too productive! (By the way, the one-day app is off on the HashRocket site, and this company offers Rails, Elixir, and React, i.e., deviating from its original plan).
Why? The fundamental reason is that coding is just a minor effort ( <30%) compared to regression testing. The faster programmers produce code, the more regression errors will be introduced. So, unless the team had a good Continuous Testing process, from managers’/executives’ perspective, the seemingly high productivity for initial sprints turns out to be counter-productive. Intentionally or unintentionally, companies will usually turn to less productive language/frameworks. They are still regression testing issues, but it is less intense.
So the lesson here is that: if a software company wants to achieve productivity (10X or more) in developing web apps, Ruby on Rails is the best option. It has been well-proven. Nevertheless, the whole team needs to learn E2E test automation and Continuous Testing to enable production releases daily first.
Anyway, my daughter loves the Ruby language. When I met Matz at the RubyAward ceremony in 2018, I told Matz my daughter is a big fan of Ruby. Matz kindly signed an autograph for her.