The use of convention in the programming ethos is a pretty remarkable thing. It exists outside of the ruthlessly binary computing process, and it ultimately is what makes any sort of code legible to human eyes. With the exception of a few outliers, the line breaks, the indentation, the question marks and exclamation points (the last two are Ruby) function to make code legible to us people -the computer could give a damn about it. The convention of giving variables or methods names that are reflective of their purpose is here again, unessential so far as the computer is concerned. One could describe an iteration through a hash as
and it would print an accurate description of the contents of said hash, but such a block is not only absurd, but is actually harmful to coding.
When building a house with a wooden frame, it is convention to place your studs every 16” on center, and altering number would pretty inconsequential. I knew a guy when I was in the trades who would intentionally nail them off at anywhere from 14” to 20” at whim, without much of a care in the world.
“What?” he would almost sneer, “it’s not like it actually makes a difference.”
But it felt to me to be almost a moral offense, and this guy most certainly made the next person’s job a whole lot more difficult.
The thing is there is something like selflessness that occurs in the use of convention. It is to acknowledge that what you are doing is not just for you at this very moment, nor is it simply giving a computer something to think about for a bit of time when programming (it’s amazing how fast computers are, isn’t it?) but that you are writing your code for other people, from now and onward. Matz said that he created Ruby to be a language to make programmers happy, and what I’m talking about isn’t so far from that. A program with well-described sytax is an approachable program, and an approachable program is like a comforable pair of shoes, which is something that certainly makes me happy.
The fact is that nothing exists in a vaccuum, and especially not coding. Convention is what makes it possible for millions (billions?) of people to collaborate within a medium of abstracted binary sequences and for it to actually make any sense at the end of the day when you put it all together. It is to think of the others that will come to what you have done, and to code with them in mind as well as creating a functional computing process.
Convention is what makes the internet possible. It is HTML as the universal language of webpages, and the call-and-response process of HTTP protocol. The millions (billions?) of servers in the world are all tuned in the exact same way and because of this we are connected across this entire planet.
Convention allows for collaboration, which in turn allows for truly incredibly things that are not otherwise obtainable, and in this way it ceases to merely be a habit or nice gesture but anessential component to computer programming.
However it is worth noting that just as there are no true vaccuums, nothing is truly absolute. Just as it was in poor choice to for the builder to nail off his studs as chaotically as he did, the convention of lead paint and aesbestos insulation were also poor choices.It seems to me that dissent from convention is every bit as essential as adhering to it can be, and that the two exist in unison without paradox. It is from dissent that new languages are born and innovations are made. Both have their function in any collective human endeavor.
Make yourself useful.