If it is too complex, you are probably doing it wrong

If there is one thing experience has taught me, it is that too much complexity

in some code usually means that design is wrong. That does not mean that

everything must and can be as simple as 2 + 2, but complexity should sound some

inner alarm and should make you reconsider your approach.


If basic concept, without all convenience features is hard to follow then it is

most certainly wrong. Adding convenience features can bring some additional

layers of complexity and certainly plenty of code, but they don't usually pose a

significant problem if basic concept is done right.


There are many practices, patterns and advices going around that should help

writing clean and maintainable code, but two stand before all else. Violate

them and you will be in trouble, sooner or later (usually sooner or in the

worst possible moment).



Comments

Popular posts from this blog

Just released eBook: Delphi Event-based and Asynchronous Programming

Magic behind FreeAndNil

Delphi Nullable with Custom Managed Records