4 ms·
> Being DRY usually makes decoding easier, not harder "Usually" being the keyword and what the article is all about IMHO. I work in a codebase so DRY that it t
by withinboredom 2y ago
> Being DRY usually makes decoding easier, not harder
"Usually" being the keyword and what the article is all about IMHO. I work in a codebase so DRY that it takes digging through dozens of files to figure out what one constant string will be composed as. It would have been simpler to simply write it out, ain't nobody going to figure out OCM_CON_PACK + OCM_WK_MAN means at a glance.
- djeastm 2y ago>I work in a codebase so DRY that it takes digging through dozens of files to figure out what one constant string will be composed as. I don't know the codebase, but to my mind that level of abstraction means it's a system-critical string that justifies the work it takes to find.
- RussianCow 2y agoSorry, but this doesn't make sense. Why should system critical things be more difficult to understand? Surely you want to reduce room for error, not increase it?
- withinboredom 2y agoI mean, sure, I guess API urls could be system-critical. But generally, I prefer to grep a codebase for a url pattern and find the controller immediately. Instead, you have to dig through layers of strings composed of other strings and figure it out. Then at the end, you’re probably wrong.
- jbverschoor 2y agoFunction calls, the essence of DRY, are only readable if it is well known and well understood what it does. When code is serial, with comment blocks to point out different sections, it is much easier to read, follow, and debug. This is also a little bit of a tooling problem