Hell's Kitchen, JavaScript Edition

25 Sep 2019

Is that a Burger?

Imagine you’re a chef putting the finishing touches on a burger for a customer. You present the burger to the customer and they stare back at you with a puzzled look. The burger buns are sandwich between the vegetable slices on the top and the meat patty on the bottom. In terms of ingredients, it’s a burger but looking at it is rather confusing. Perhaps if Gordon Ramsay was screaming over your shoulder about how the structure of the burger should be “bottom bun, patty, vegetables, and top bun” then the burger wouldn’t cause confusion. Making a proper burger and writing proper code share one thing in common - the existence of rules and conventions.

Getting Roasted

In my case, I was the chef and ESLint with IntelliJ was Gordon Ramsay. My first encounter was like a rookie chef on an episode of Hell’s Kitchen, I was thoroughly roasted. There was blaring read lines everywhere as if ESLint and IntelliJ were screaming at my face over every issue be it minor or major. This initially felt disheartening and annoying that I had to go back and address the errors one by one. After all, if my code arrives at the same output it should be all good? While that may be the case for now, but working in a group or company environment will involve others reading my code. They may give the same puzzled look as the customer seeing the abomination burger as they struggle to read my code.

Getting the Motions Down

After a week of using ESLint with IntelliJ, my code has the structure of a proper burger than the abomination burger from the story. I’m still slightly annoyed by ESLint telling me for the hundredth time that I missed a space or was supposed to use single quotes (not double quotes) for a string. However, the constant reminders of my mistakes reduced the likelihood that I will repeat the same mistakes in future projects. I learned the proper conventions by practicing and correcting errors. This was far more effective than staring at the documentation page for a few hours to try to memorize all the rules.