February 25, 2014
Today’s technological landscape offers a plethora of platforms—enough variety to solve almost any problem. Want to create a mobile app? You can choose iOS or Android. Want your solution to be device agnostic? Make an HTML5 application. Want to build a website? Take your pick from CakePHP, RubyOnRails, or Python. The choices are numerous and can often seem daunting, even to the seasoned developer. But the truth is, code is just another language. Learning a new programming language is similar to picking up French, Spanish, or any other linguistic construction. There is a systematic way to learn, strengthen, and master various programming languages. Let’s take a look at the overlap between the two:
1. Practice Makes Perfect
For a non-technical person code can be daunting. But like learning a foreign language, practice makes perfect. Some of my colleagues do not develop in their day-to-day work, they don’t have a background in computer science, and they lack development experience. However, by reviewing their more technical colleagues’ code and playing a role in development projects, many become comfortable enough to read code and complete light modifications. Exposure to various programming languages utilizes a ‘learning by osmosis’ approach, which benefits the individual and increases cross-team collaboration.
2. Brevity is Paramount
The most effective emails are those that communicate the message with the least number of words. There’s less chance of confusing the reader or losing the point of the message. The same can be said for code. Rarely is it better to use more lines than needed. Unnecessarily long code increases the chances of creating a bug and makes it harder for someone else to understand. When communicating in a foreign language, would you prefer a concise and clear message, or a long-winded narrative? It’s as simple as that.
3. Formatting and Structure are Vital
When learning how to write essays, one of the first drills is to divide the argument into logical segments. The academic structure starts with an introduction to set up the tone or argument, followed by body paragraphs for detailed support, and then a conclusion to wrap everything up. This common format enables the reader to easily understand the content, and code works the same way.
Well-written code lends itself to smaller sections of code, called functions, that get used elsewhere as a part of a larger effort. This allows the codebase to be more readable to future developers, since each section provides unique value to the project as a whole. If one section of the codebase needs to be improved, it could either be replaced with another idea (use different code), edited to fit into the larger project (change the logic), or removed if it no longer fits.
4. Languages Evolve Over Time
Modern English differs from its Old English roots, and modern Chinese is a far cry from its classical ancestor. Over time, slang works its way into languages, and words even start to redefine themselves. Updates are made to the Oxford English Dictionary, often to officially incorporate commonly-used slang into the language. Similar updates happen in programming languages too.
C++, for example, is very similar to its predecessor, C. One difference is that C++ allows for Object-Oriented Programming by design. Object-Oriented Programming was becoming a guiding principle at the time of C++’s genesis, and so it was created with Object-Oriented Programming as a feature. C++ itself is still going through updates to this day, improving performance and support as technology evolves.
5. Reading Expands Horizons
To this day, I’m not quite sure why I was required to read The Great Gatsby, Hemingway, or Shakespeare. Nevertheless, being well-read has great personal and professional benefits. Through reading, one can learn to see the world from different points of view and gain insight into experiences that may not be immediately available. Gleaning knowledge from various works could be valuable in future endeavors, even if it may not be immediately obvious how that knowledge can be used.
Reading other people’s code can work the same way, particularly when learning new languages. Example code from an introductory book or excerpts from a larger open-source project can provide insight into how the language is intended to be used, what kind of idioms there are, and techniques to avoid certain problems. Code might look like a mish-mash of misspelled words and symbols but someone wrote that code and it carries meaning. Like spoken languages, it may take a while before you can communicate to others, but you can grow to comprehend what others are trying to say to you.
What do you think? Was learning your first programming language like learning your first foreign language? Leave your comments below!
Read more about our managed services for cloud applications, Bluewolf Beyond, coding best practices on our blog, or contact us to learn more about our development practices.