Why Learning Your Second Coding Language 'Should' Be Easier

Posted by Christopher Kalfas on September 18, 2019

So, it is time for the second installment of my coding blog series. And it the second time I struggle to find a way to contribute to the coding-blogging world. School wise, I just completed my mods on Ruby and Rails. Next up is JavaScript. The transition from Ruby to Rails is natural and designed to work in tandem. JavaScript is a whole new language. While I certainly feel confident in my ability to use Ruby logic and put together a web app quickly in Rails, that won’t help next week. All of that knowledge goes out the window. Nothing I learned in Ruby will help me succeed as I learn something completely different.

OR WILL IT?!?!?!

I started looking into JavaScript and eventually recovered from my fits of code-based swooning. I began to notice my initial-gut impression to something brand new may not have been correct after all. I saw I was moving through a lot of the logic and exercises much faster than I did in Ruby. Learning about loops and iterating in Ruby took days or weeks (let’s be real…it was weeks). It was stressful and tedious, and every time I heard the word iteration, I would think of Inception.

Not the case, with JavaScript. I lot of familiar concepts started to appear everything. And I couldn’t help but get a sense of strange Déjà vu.

I was picking up the differences in syntax and logic much faster because I was familiar with the logic in Ruby and it wasn’t because I had called the ghost of Alan Turning during a séance. While they are different languages, their core concepts and some aspects of structure are similar.

For example, in Ruby, you define variables, methods and loops like this.

And in JavaScript, you do this.

Not so bad after all.

There some syntax differences, but even if you have never read a line of code in JavaScript, you can understand every aspect of the code. There will be a tough learning curve while your brain learns how to store this information in your lizard brain, but it’s very doable. As the dots started to connect like at the end of a good episode of “Sherlock,” I began to think of other areas where I’d seen ‘universal’ patterns across different styles of communication.

In a previous life, I was an actor. The difference between high school and college was the amount of time I spent on stage versus the amount of time I spent in the classroom. We spent much more time developing our ‘Actor’s Toolbelt.’ I was learning a massive systematic technique to approaching any role, and learning how to prepare for anything we would encounter. A valuable skill we honed was: how to dig into the script, discover clues ‘inferred’ from the author, and bring it to the acting. Acting is just more than saying lines; a small aspect is ‘how’ you speak or sing them. And not just the words themselves.

In music, being able to sing in rhythm actuarially is essential. There are rules just like in spoken languages and coding languages as to how to approach the right timing or ‘delivery.’

The symbols on the left are rest notes relative to the time signature. The symbols on the right are how rests are represented in at least ‘4/4’ time.

Being disciplined regarding the timing is the difference between Whitney Houston, and you at karaoke; among other things. Just like in music, a script with dialogue will also have internal rhythms inexperienced actors will miss. For example, a lot of Shakespeare is in iambic pentameter. I won’t get into the nitty-gritty of it, but basically, the rule is, a line should have ten syllables. If it doesn’t, it’s a for a reason.

All it means is that you have a line of poetry made of five ba-DUH rhythms:  ba-DUH ba-DUH ba-DUH ba-DUH ba-DUH.Here’s a line with ten

“Two households, both alike in dignity.”

And another one.

“Now is the winter of our discontent.”

These lines are both expositional and ‘should’ follow the standard rules of iambic pentameter - nothing unusual about those lines.

Here are some examples of Shakespeare breaking the rule he made famous.

“To be, or not to be, that is the question:”

And another one.

“Is this a dagger which I see before me, The handle toward my hand? Come, let me clutch thee.”

Macbeth’s and Hamlet’s most famous lines are both eleven syllables. In these moments of the plays. Macbeth sees a phantom vision of a bloody knife that he reaches for and tries to grab in his hand, and his hand passes through it. Shakespeare even tells you the exact syllable Macbeth’s hand should pass through the phantom dagger if you are counting. It’s the first sign that Macbeth’s motivations have started to move from protecting Duncan, his King, and BFF and murdering him to become king. For the Prince of Denmark, he is saying out loud for the first time if the events surrounding the death of his father and his uncles suspicious marriage to his recently widowed mother, have pushed him to consider whether he should live and try to solve the mysteries that surround him or take his own life to escape the madness of it.

The reason Shakespeare makes the 11 syllables is to clue the actor to the fact that these are huge revelations and an actor should take a (beat or rest) for following nine syllables to let it sink in with the audience. And like in music sometimes the lack of sound is more profound than its presence.

My point in making all these connections is not as much to offer some practical tips to make coding easier. Instead, its to tell you to give yourself some credit. Trust the patterns you begin to recognize when learning a new language every time you pursue a new one. Your pattern recognition will be THAT much stronger, and you’ll be a multilingual coding genius in no time!


Sources Google Translate StudySpanish.com Music Theory Academy No Shit Shakespeare