I find it amazing how many different meanings we can get from less than 30 characters. I’m talking about the alphabet with some well-placed punctuation, of course. From a love story to a computer program, writing has allowed us to create extraordinarily different worlds. And language, in general, provides a framework in which we can hang a stream of ideas.
Most programming languages seem to have very strict standards — certain terms have to be used in certain places. But one area where there is an enormous amount of freedom is how we name those terms.
Take this simple program which creates a sentence from an array of words, adds a punctuation mark, and logs it to the console:
Nothing too special, right? But what you may not have considered is how many terms you were responsible to name.
There are 23 words (not including hard-coded values) in the above program. We controlled the names of 14 of those words. That is more than 60% of what was typed, was our responsibility to name!
Whether you are building an enterprise application or a simple Hello, World, you want your program to read like a Times Bestseller, not a Mad Libs workbook.
Most of these conventions are not for you today, but instead, for you and the people reading your code tomorrow.
References and continued learning
Thanks for reading!
Follow me on Twitter.