The Grammar of Programming

22 Sep 2022

The Grammar of Coding

Learning a new language is difficult. Growing up I learned three different languages. Although I’m not fluent in all three, you learn to appreciate each one and learn their differences and similarities. In this regard, I believe that true proficiency of a language resides in one’s ability to use grammar correctly. It’s easy to learn vocabulary words, but are you really speaking a language if you don’t make any sense in the process? I believe the same goes for programming languages. There are many similarities and differences between programming languages, but when coding, being able to understand and write the code in a way others will understand shows proficiency.

Grammar is the technique of a language. There’s a standard way to use the language, and there’s also different dialects and slang. Coding grammar shares many similarities to spoken languages in that same way. Take a ‘for loop’ for example. In JavaScript, there are multiple ways you can iterate a ‘for loop’ other than the standard method. You could consider the other methods ‘slang’ for an iterator. Code styles could be compared to dialects, where there are different standards in grammar, word usage and mannerisms.

Using ESLint

I believe that coding standards and grammar are one in the same. Currently I’m utilizing ESLint in the IntelliJ IDE as my code style. So far, ESLint is very easy to use. Having used other coding styles previously, I believe that proficiency over those styles has helped me to quickly adapt to ESLint. I believe that using these coding styles can help anyone to program better, more efficiently and helps people learn how to code. Coding standards helps the legibility of coding. It’s imperative when working on a team that everyone is able to quickly read, understand and take over when other people are switching tasks, or need additional assistance.

I do believe that coding standards are not perfect. Dialects add a layer of complexity to a language that is specific to geographical locations. Same way coding styles are unique to a subset of programmers using that language. ESLint is but one of a few different code styles for JavaScript. This means that the standard is different for other programmers. This may or may not mean that the code formatting is different.

You can take a look at ESLint here.

Coding Standards are one of the cornerstones for excellent programming. It should be expected that programmers have proficiency with the standards of the languages they specialize in. To learn and adapt to standards of other languagues they learn in the future. I plan to practice my coding standards to further increase my ability and chances of success in the workplace after graduation.