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).


  1. Agreed ! I'd put one other principle even before those two - OnceAndOnlyOnce. On all levels.


Post a Comment

Popular posts from this blog

Coming in Delphi 12: Disabled Floating-Point Exceptions

Assigning result to a function from asynchronous code

Beware of loops and tasks