Six weeks into the Web Development Immersive program at the Flatiron School and I’m smitten with Ruby. It’s hard to not be charmed by a programming language that provides flexibility, finesse, and a lovely library of methods. I often heard people exclaim that programming in Ruby could turn code into poetry.
I was concerned with understanding the major similarities and differences between the two languages. So, I scoured the Internet and Google to collect tidbits of information to assist me in this transition over to JS.
Here’s a collection of those tools and resources.
OOP and Same, Same but Different
Both Ruby and JS are Object Oriented Programming languages. This term should already be quite familiar to you if you have already learned Ruby.
Here’s a great OOP description which I came across in my early Flatiron Ruby lessons:
“An object-oriented approach to application development makes programs more intuitive to design, faster to develop, more amenable to modification, and easier to understand…….
As humans, we’re constantly faced with myriad facts and impressions that we must make sense of. To do so, we must abstract underlying structure away from surface details and discover the fundamental relations at work. Abstractions reveal causes and effects, expose patterns and frameworks, and separate what’s important from what’s not. Object orientation provides an abstraction of the data on which you operate; moreover, it provides a concrete grouping between the data and the operations you can perform with the data — in effect giving the data behavior.”
— Object-Oriented Programming with Objective-C, Apple Inc.
Need a quick primer on OOP? Check out this five minute video:
Again, since Ruby and JS already have this basic structure in common, you will be happy to find out that many of the same concepts you learned for Ruby will exist and be applicable in JS. Elements such as variables, hashes, arrays, methods, loops, classes, and conditionals exist in JS. The major differences between the two may come down to syntax and some logic.
Luckily, this path has already been paved before you. Here are a few articles I found that outline this topic:
Flatiron School Blog:
Side-by-Side Comparison (**very helpful)
Error Messages are still your frenemies
By now, you’ve learned to expect a barrage of error messages to flash on your screen whenever you attempt to run your Ruby programs. Many of them you recognize and receive again and again so converting them over to green is not a problem. There’s always a few that keep you up at night but, eventually, you conquer them.
Ruby error messages are descriptive. With tools such as Pry and Byebug, you are able to better understand what is going on with each line of code.
Here are a few resources to review to get you started on the right foot. Of course, if you still hit a wall you can always copy/paste it into a Google search.
As nervous as you might be to learn another language, you’ve already got the knowledge and skills to take on this challenge. Just now that tactics you already learned by this point are still going to serve you well: persistence, creativity, Stack Overflow, and Google.
Got comments, other helpful links/resources, or feedback for me? Please feel free to leave them below. Thanks for reading.