Words are like Finely cut Diamonds
I don’t want to sound corny, but writing software is actually pretty similar to writing good poetry. If you’ve ever read good poetry, you would notice that what separates a great poet from a poser or a pretender is good poets economize with their words. They understand that words are like finely cut diamonds with many different shapes, and each shape brings to mind a wide range of emotions. A good poet is really is an emotion sculptor. He or she uses words to bring out an emotional state, which they then craft and manipulate to a desired state.
It’s kind of like listening to somebody playing a violin. Great violinists are able to play classics with such emotional honesty and urgency that you can’t help but feel transported. You really can’t, and this is because there is an artist in all of us. It doesn’t matter how technical your background is. It doesn’t matter how clueless you are about the arts. All of us are artists because all of us are emotional beings.
Coding can be Done inElegance
Don't get too bogged down in process
Don’t get too bogged down in process. This is the first thing that you need to learn. Truly inelegant code is necessarily long and bulky code. There are really no two ways about it because the person writing that code actually sees himself as somebody who’s just patching modules together. Not surprisingly, if that’s the person’s attitude, then the work product would reflect that mindset.
Second, it’s all about results. People who write elegant code understand that ultimately, it’s about results. So, what they do is they try to get from point A to point B as quickly as possible without taking too many resources and taking up too many lines, and this requires an artist’s sensibility because it’s easy to draw a line but you know it’s a Picasso when a line is drawn a certain way.
Simplify Your Results
Real artists who produce truly elegant work are very simple yet the simplicity of their work packs a lot of power. If you’re looking for an example of this, read Sylvia Plath’s work. It’s really mind-blowing because there’s an economy of space there, but the emotions are so raw, so real and so intimate.
Cut Down on Resources
Just like writing poetry with an unlimited budget of words is a bad idea, writing code with a mindset that you can always add another line leads to really sloppy code at best and at worst, dangerous code. By dangerous code, I’m talking about you produce software that cannot be upgraded. Seriously. How can it? Because you’ve written such clunky text in certain portions of the code that if somebody tried to add another module or expand on particular subroutines or segments or existing objects, it would be a mess.
Think of it this way. It’s like pushing on a balloon. When you push on a balloon, the only thing you can control is the place that you are pushing on. Everything else is up for grabs because you don’t know which other part of the balloon would swell up. The same applies to inelegant code. You just know what kind of upgrade will blow your work.
Finally, if all the above make sense to you, then what I’m about to say should flow naturally. Not only should a great code seem like it’s quick and easy, but there’s absolutely no bloating involved because if you write elegant code, you focus on packing as much power and efficiency into each line. This enables you to simplify to the extent that the more you cut, the more powerful the overall product becomes.