Coding Standards Reflection

06 Feb 2019

Coding Standards and the Never Ending Debate

After a week using IntelliJ and the ESLint coding standard, a programmer who has been told that in JavaScript that whitespace does not matter will throw a tantrum about ESLint errors being thrown when there is “too much blank lines at the end of the program.” I really do not see any reason other than readibility is there a need for these kind of stylisic standards when deep down in the compilers and Assembly, it does not matter whatsoever if there is a space in between the function name and the parameter list open bracket. Then when I go and try to read other peoples code, especially new programmers first code where things are all over the place and comments are on the same line, but also on the next line, sometimes on the line below for whatever reason, variables are being created, but never used etc. I can see why enforcing a style of coding can help in a way, however all in all it does not matter.

In the “beginnning”, there was Imperative

Coming from the Computer Engineering side of things, one of the first languages I learned was C. I grew up using BASIC on my dads old Apple II and things were a bit shaky at first, but after leaning the syntax, my mind rushed back into the algorithmic thinking of programming games, or automizing certain long calculations that would take forever to with pencil and calculator. I would say that I am decentkly fluent in C, or at the very least have an advance knowledge of C and right now, the one thing that I have taken away and have “used” extensivley in my programs is tha fact that mmost languages will not care about whitespace. You can have a million lines between the function call and the first line of the function body, but the compiler will not care, the CPU will not care, the memory controller will not care. So I say, space away.

Though with every rule, there has to be exceptions. And boy are there a lot of exceptions.

The Inevitablability of Other Peoples Code

I believe there are few truths in programming: 1) the compiler is always right 2) the language is always right and 3) my code is the best and nobody can tell me otherwise. Whether we believe it or not, these truths hold. So it was a big surprise to me that someone would DARE tell me that you need at least one new line at the end of the program.

One of the most horrendous things one can gaze upon is a beginners programer code. And that will extend to everyone. Everyone has written bad code in thied life, from having illogical loops and variables that serve no purpose to being so unreadable that it could break Google translate. That being said, one does not learn if they do not make mistakes. So one must nurture the growth of a young programmer. Fostering the logic and spacing of the Gods, the One True Programming Style (OTPS). This is where I concede the fact that coding standards are very appropriate so that the future stays nice, bright, logical, and readable.

But, after one overcomes the hurdles of life; bring free from the yoke of noob-dom. One can argue, do rules even apply after that?

Who’s Language is it Anyway?

One of the most inspirational things to happen to me in university, was not becoming fluent in some languages, nor was it solving complex integrations in Calculus. Not even when I was released from the bug demons clutches in the C programming course. It was in my Linguistics class, specifically the “Linguistics of Pacific Island Languages.” The professor was very dedicated and envigoriatd in his field, the conservation of the Roviana language in the Solomon Islands. He claims that “you do not speak your language wrong.” Stating that “no one should tell you your speaking your language wrong.” That claim truly opened my mind on how I approach langauge and communications, and how to become more opened minded of how people communicate. Just because I cannot understand someone who claims to be speaking the same language as me, does not give me the right to claim that they are speaking wrong. I believe that everyone should hold this value to their heart so we can better our understanding of people, and hopefully become a more inclusive society.

Now how does that relate to code? Well, what is coding, but a way to communicate to the hardware what you want it to do. And to become “fluent” in a particular programming language is to use the tools of the language to effectivly communicate to the computer and to others. So, do you not speak your langauge wrong? One can say that one can program in a langauge wrong. Such as forgetting a semi-colon and g++ yelling at you that you forgot a semi-colon. Yet we have language like JavaScript that say, “yeah we know what you meant.” Obviously we need coding standards when we first learn how to code, such as we need to be taught how to talk by our parents, teachers, etc. so we can communicate with them. Same can be said in programming. However, once you reach that state of being able to communicate with the neccessary people, do you stay the same? Never breaking from the strict and narrow confines of the langauge? This is where I believe that after the basics, you can throw away most of the “header stuff” and do what you can understand. Yes, you must always declare the return type of a function in C++, no you do not have to define member functions outside of their respective class declaration. Experiment with the language format, push the boundaries of the code. Besides, isn’t that how we even have multiple language and paradigms in the first place?