Holding tight to the concept of harmony

At least when you're coding

André Staltz
4 min readFeb 19, 2014

Programmers sometimes advocate hacking as a beautiful thing to do. "Let's let go of the concept of harmony", and that sort of thing.

I'll be very upfront and say this is wrong. Programming should be pure harmony, and doing whatever makes you happy when coding is a bad practice, specially in a team.

For starters, let me explain that I fully understand what hacking is, and I've been grown up in an environment where hacking is actually the only way of living.

A gambiarra on a bicycle

Let me introduce you to my home country: Brazil. There, hacking is the norm. We even have a couple of slangs for different kinds of hacking: we have "gambiarras" (kludges, in English), "jeitinho brasileiro" (smart social hacks Brazilian-style), "jogo de cintura" (hacking your way through social structures for your own benefit) and others.

Norms in Brazil are usually seen as a challenge to people's creativity in hacking around them. Traffic speeding radars are never taken seriously: drivers make web app maps of all the current radars, so they can speed up at will whenever they aren't close to one. Many pedestrians prefer to cross a busy highway full of fast cars and trucks, than to use the catwalks. When traffic authorities build fences between the highway lanes, Brazilians break the fences in order to walk across the high way.

Behold a "gato".

Another very common hack is the well-known "gato" ('cat' in English): a clever way of stealing electricity or TV signal from street light posts.

Traffic hacks and gatos are very popular in Brazil, but these are just the tip of the iceberg. Hacks are pervasive, present specially in politics, commerce, and home appliance hacking. People are very creative and new gambiarras are found everyday.

While people still get stuff done, it is obvious that gambiarras and social hacking in Brazil are practices that benefit individuals in the short-term, while harm the society in the long run. It is simply unwise and selfish. Consequentially, as a society, Brazil is packed with problems. That is really not the kind of result we want in the technology industry.

Before giving reasons why ignoring rules in coding is bad, let me also state that I'm a composer but I typically don't like following rules and I know little of musical theory. You could say, in regards to rules, that I hack my way in composition. I make music that makes me happy. I actually do let go of the concept of harmony (and others) and just let my creativity flow.

On the other hand, as a programmer, I know that code needs "harmony". Coding is not music, neither painting nor dancing. Code is not art. Yes, code requires creativity and smart solutions, but breaking the norm, not living by other people's expectations, and code what makes me happy are practices that bring more harm than they bring benefits.

Programming is mostly about communication. Even though we code to solve problems, the way we solve problems is also important. Friendly programming languages like Python exist to make technical solutions easy to understand and talk about between programmers. It's not just about moving around zeros and ones, it's a lot about communicating properly how those ones and zeros are moved. It's about collaboration. If you hack code without living by other programmer's expectations, you're only bringing hell into their lives once they need to use or debug your code to make things work. Don't do that. Give them some "harmony".

Code reviews exist so that programmers live to each other's expectations and work flows smoothly. Code conventions and rules exist for a reason: try programming in a team where they are none and you won't have any space for "being happy" anymore, you'll be lucky to get any work done. Professionally, there is no space for happy hacking except maybe for prototyping or small hobby projects.

But even then, you might want to use your hacky project years after you built it, or shape your prototype into a real product. Do your future-self a favor and code properly, with rules, order, harmony, documentation, etc, and you will be helping yourself in the future just like you would be helping a work mate in the present.

Mastering programming is the sweet spot between creating clever shortcuts and following healthy standards. Don't break this balance.

Make other programmers happy with your code.

--

--

André Staltz

Reactive programming expert, JavaScript functional programmer at @futurice, http://reactivex.io addict, http://cycle.js.org creator. http://staltz.com