Email or username:

Password:

Forgot your password?
Top-level
Graham Downs

@jk So when four things fail, you have to go through the 270 lines of abstract, generic code looking for the correct line to change.

As opposed to fixing it in one of the four places but forgetting the other three.

Meh. It's a subject of debate. I'd still rather have a single place to change it. 🤔

6 comments
slotos

@GrahamDowns @jk remember, code looking similar doesn’t make it the same.

DRY principle is about knowledge, not code. There’s an expensive difference between the two.

Graham Downs

@slotos That's fair too. Each of those four implementations could be slightly different, and for various reasons, need to stay that way. Not every hammer is suitable for every nail. ;-) @jk

mikeTesteLinux

@GrahamDowns @slotos @jk So true. DRY is usually interpreted so "by the book" that sometimes it give birth to a monstrous code.

Sean Murthy

@GrahamDowns @slotos @jk Nothing a little control coupling can't fix. 😉

Bee O'Problem

@GrahamDowns @jk eh

IME the former = an hour to fix, an hour to notice I missed something then a few minutes to find the copypasta that wasn't fixed. Maybe an hour or two if I feel like refactoring it into a function/class/whatever.

The abstract mess is hour(s) to find the part to change. Changing it, then hours more figuring out why it broke in some weird illogical way instead of fixing the problem.

Graham Downs

@beeoproblem @jk I've had cases where it was months to find the other parts I missed. After the next release. When it was in the hands of a client, and caused a show-stopping bug for them. Because the dev who fixed it didn't know (or had long since forgotten) about the other three.

It happens. :/

Go Up