Ruby vs. Python vs. JavaScript – What Programming Language To Learn First?

When I started programming, I struggled with deciding on a language. What programming language to learn first? How does one decide between Ruby, Python and/or JavaScript?

It’s an interesting question. I wish I could have seen the image below when I was trying to make sense of it:

FizzBuzz written in Python, Ruby and JavaScript

The three programs above all do the EXACT same thing. JavaScript on the left, Ruby in the middle and Python on the right.

All three print a count from one to fifteen. When the count is evenly divisible by 3 and 5, it prints ‘fizz_buzz’, when evenly divisible by 3 it prints ‘fizz’ and when evenly divisible by 5 it prints ‘buzz’. If none of those, it prints the number. You can see the count listed at the bottom of the image.

This is a classic computer programming exercise.

Aesthetics of Code

Whenever anyone shares their opinions on aesthetics, it’s important to remember that there are no right answers. Aesthetics are a matter of taste. So I’m just sharing my taste for code here.

The JavaScript file on the left requires considerably greater amount of keystrokes. It looks confusing. I see lots of opportunities to make mistakes.

Python is clearly the most concise. The Python code is three lines shorter than the other programs.

I like that Ruby doesn’t require semi-colons or colons. These symbols are annoying and require a close look. For me, it’s easy to mistake a semi-colon for a colon.

There is a question about how to write variables. One way is camel case (writingVariablesLikeThis), another option is to use underscore case (wirting_variables_like_this). Camel case is more concise, but I think it’s less aesthetically pleasing than the alternative.

In terms of aesthetics I can rank order the languages. Here they are from the prettiest to the ugliest (ugliest=JavaScript).

  1. Ruby
  2. Python
  3. JavaScript

Does that mean that I recommend learning Ruby as a first language?

Not really.

What Programming Language to Learn First?

Do this in order:

  1. HTML
  2. CSS
  3. JavaScript

JavaScript is the scripting language that you WILL learn if you care to write applications on the web.

All websites that have moving stuff use JavaScript.

Once you learn JavaScript, the other languages will be far easier to learn. I think switching from JavaScript to Ruby is actually interesting and fun.

If you come up learning Ruby, switching to JavaScript will seem like running with an irregularly sized weight chained to your hip.

Also, I’d suggest learning using Free Code Camp. I’m making a series of videos which I hope provide some special insights into the course work.

Enjoy!

Reno Walking Commute – Apt to Office

This is the view from the apartment.

The hallway leading from the apartment to the elevator.

The view from the elevator entryway.

The elevator has mirrors in it.

This is the sidewalk in front of the apartment.

A bridge that crosses a part of the Truckee River.

A Truckee river duck.

Another view of a Truckee river duck.

The office is a two block walk from the river.

The stairway leading to the office.

Finally made it. She let me in.