Tuesday, March 3, 2009

KISBNS

Keep It Simple, But Not Stupid!

The idioms KISS (Keep It Simple, Stupid!) and KISSALAP (Keep It Simple, Stupid, As Long As Possible) are great methods to get your code up fast and keep it stable. Surely writing code for something you'll probably never use can only make thing unnecessary complicated and therefore unstable and unmaintainable.

BUT:
I often see pieces of code where people tried to keep those principles, but forgot to refactor in time until it's too late. What I mean is, people tend to start copying pieces of code, thinking 'making this piece of code more generic while I would only use it twice is not simple enough.' Maybe that's true. But then they copy it a third time, or code it again because they forgot it allready existed somewhere.
In these cases making a generic method, class or whatever the first time would have been a better idea.

So as soon as a piece of code is obvious to reoccur several times, extract it immediately before it's too late!

scalable architecture

Very often when I join a project, I see developers performing all kinds of tricks just to stay within their architecture.

Sure, it is a good idea do determine or develop some kind of architecture when you start a project. If you don't do that after a while your software won't be readable or maintainable anymore. Developers will come and go, each bringing in their own style of doing things. But if your system evolves, it's very likely that your working architecture will not live up to its needs. Therefore don't hesitate to adjust your architecture instead of wasting time and money trying to figure out hacks to solve the problem within the current standards.

In other words: ''Scale your Architecture''