DEV Community

Basic principles that will make your programming life in 2019.

Sandip Mavani on January 10, 2019

I have seen code that only the programmer who writes it understands how it works. However, when one asks the programmer to explain what the code do...
Collapse
 
kungtotte profile image
Thomas Landin

A really important part of the DRY principle is that you don't know that you need to make it DRY before it's already WET.

Until you've written both the A and B examples you don't know that you need a function. In simple examples like this you'll probably figure it out as you start writing B, but if you started out with the DRY example and only needed it once then you did that work for nothing.

Collapse
 
quantumsheep profile image
Nathanael Demacon

The YAGNI really makes me laugh, that's exactly what I do and that's exactly what happen 😂

We, developers, have issues to NOT make extra helpers functions or variables that are useless!

Collapse
 
patricktingen profile image
Patrick Tingen

Important to know that DRY is more about knowledge than code. Check this comment for a link to a /very/ interesting article