Codementor Events

A DRY KISS and a SOLID base with YAGNI

Published Jun 07, 2017

As a developer you will be confronted with a lot of buzz words as mentioned in the headline. The point is that they have not the same value. Let us figure it out.

KISS as the most known abbreviation refers to simplicity. The problem is what is simple to one may be simple to the other. Of course you can have consenses over some issues but there is measurement possible why something is simple or not.

YAGNI is refers to features that are not requested. So you should not implement them. Using this on development level is counter-productive. Of course you should always implement more than requested. Your job as a developer is to find obvious elements that should be abstracted to have future purpose. This is the "more" you have to do: Implementing features for the development. YAGNI should not applied on development level. On management level this behaviour is appropriate. So end-user features should not be implemented if not requested.

DRY may or may not be a problem. "Don't repeat yourself" seems to be most of the time a really good idea. But sometimes it is misleading. Because code repetition is only a problem if the semantic repeated as well. Duplicate code is not a problem if it serves different semantic. Furthermore it should be kept seperated as it will lead to the error type II (assuming redundancy, but there is none). Redundancy is important on the semantic level not on the code level.

The most well-formulated but hard to understand principles are the SOLID principles. SOLID is a set of principles which have either a mathematical, statistical or semantical background. And the most interesting thing is: You can measure them if you want. Honestly I have never seen it... My personal opinion on it is that programming seems to be more a creative than an engineering process.

In short: The most important abbreviation for a developer is SOLID. It provides a set of measurable principles on semantic level. They guide you through the jungle of design decisions and keep your code as clean as possible if you apply them proberly.

Discover and read more posts from Arne Lewinski
get started
post commentsBe the first to share your opinion
Theo van der Sluijs
5 years ago

Short but nicely written! A it could use a bit more clarification on SOLID. Thank you

Show more replies