Thursday, September 10, 2009

About a stackoverflow-comment I wrote: Best practices, summaries and Zen

Once upon a time... I answered a question on stackoverflow.com (What do you consider the 1st principle(s) of programming?) a little bit zen-likely. The standard answers were "kiss", "dry" and "yagni" which I not only like but try to embrace wherever possible. Nevertheless, there is much more to say about that and therefore here is my little "zen-garden" of programming tips in 4 parts:

Zen, part I: Programming is only the road, not the way.

Programming is only the technique to teach a computer what it's gotta do. To be successful in creating fast, reliable software means to know your algorithms, best-practices and all the other stuff not necessarily connected to your programming (language).

Zen, part II: If you are in a hurry, stroll along. If you really are in a hurry then take a detour.

Sounds silly but do not let yourself get into compromises that (really) may trouble you afterwards. "Stroll along" when the project is in a total hurry? It works if done right.

For this I got a rule: In case you are at the core of a program, try to be as precise and good as possible. If you are using methods from the core that are deep in your software, try to be faster in coding. If you are coding above these two, you can even get a little bit more sloppy. This way you will prevail headaches by not spending time to trace "unexpected behaviour" of core functionalities (and all relying parts to them).

Remember: Design errors are the hardest to find and/or fix. Next step on the ladder are programming errors in parts everyone relies on, then the "real showing-off software parts" (like UI or web interfaces). If you need to fix a design error at the end of a project, it means to fix it through the persistence layer, the protocols, the client... ahem. Not good at all.

Zen, part III: Know your path, Neo.

Know your environment, tools and the stuff you rely on on a daily basis and get it sorted so that it works for you. Best if you use your programming "environment" so natural that you do not even have to think of it. If you have to get a job done do not introduce "fancy new stuff" but do your work. This stuff can be introduced in a new project, namely then when you have time to prepare and use it.

Which leads to the thought that you "should stay onto the stuff you ultimately know. Anytime." Right?

Completely wrong. Try to learn something new every day. At least try to inform youself about new thingies out there, not in detail, not remotely complete but open minded.

I am sure you accomplish this, because to learn something new you are reading this blog right at this moment. Aren't you?

Zen, part IV: Do you think that's air you're breathing?

Never, ever, think you're the best in what you are doing, if so, you only could get worse;-). And never be satisfied with the techniques you know and therefore stop listening or learning to new ideas.
At least try to be open minded enough to listen to new concepts, strategies or - even - programming languages and paradigms. That advice is the most necessary - and most valuable- I might give to you for your (programmers) life at all.

Labels: , , , , , , ,