DRY is probably my least favourite programming meme. There are far too many overzealous juniors who learned it and have a bee in their bonnet about creating absurd abstractions around any two lines of code (or config) that have vague or imagined similarities, locking in all sorts of annoying indirection.
Don't write clean code, write CRISP code
61–70 of 170 posts
Re: Don't write clean code, write CRISP code
#62Earlier quoted context omitted.
I‘d like to extend it to SIMPLED: D - Duplicated: it's always good to have backup code at hand.
I'd go with SSIMPLEDD - because it needs to Scale and more Duplication must be better?
I - Iteration: As we showed over the last 2 hours, iteration is always the way to go.
Re: Don't write clean code, write CRISP code
#63DRY is probably my least favourite programming meme. There are far too many overzealous juniors who learned it and have a bee in their bonnet about creating absurd abstractions around any two lines of code (or config) that have vague or imagined similarities, locking in all sorts of annoying indirection.
Totally agreed. I've tried explain exactly this issue in a talk [1], trying to find a useful synthesis between different paradigms like KISS, DRY and YAGNI. [1] https://www.youtube.com/watch?v=0FIZn2trkoA&pp=ygUXbWljaGVsI...
The best was KINDergartener (uses all the letters). I would describe this as a programming paradigm for people who are new to the programming and real work and havn't found out that the getting shit done and shipping the code to users is the most important state for code to be in.
Re: Don't write clean code, write CRISP code
#64Re: Don't write clean code, write CRISP code
#65Earlier quoted context omitted.
I'd go with SSIMPLEDD - because it needs to Scale and more Duplication must be better?
Great! Let me propose SSIIMPLEDD: I - Iteration: As we showed over the last 2 hours, iteration is always the way to go.
Re: Don't write clean code, write CRISP code
#66I can't stand the insistence on "idiomatic". Taken to extreme it is essentially gate-keeping and dogma: "We have always done it so."
To me, code that is not idiomatic sounds wrong, which is at least a cognitive hurdle (you need to spend more thinking power to unravel/decode it to figure out the meaning). I believe this is in line with the usage regarding natural (human) languages. A sentence might be syntactically correct but if its non-idiomatic it sounds wrong and throws the listener(s) for a loop understanding it.
A very simple example is that in C, I greatly favor allocations to be written according to:
P = malloc(N * sizeof *P)
where P is the pointer variable receiving the return value, and N is an expression yielding the number of desired elements. The sizeof is completely idiomatic, always present unless I'm allocating an actual byte buffer, and always de-references P like that to lock the size to the receiving pointer. So this is my idiom for how an allocation is written. It might (should!) be yours, too but that's not a requirement in a personal principle I guess.Re: Don't write clean code, write CRISP code
#67DRY is probably my least favourite programming meme. There are far too many overzealous juniors who learned it and have a bee in their bonnet about creating absurd abstractions around any two lines of code (or config) that have vague or imagined similarities, locking in all sorts of annoying indirection.
For best results, set your DRY dial to 8 or 9 out of 10. Settings higher than 9 result in premature or excessive abstraction. But if you hate DRY so much, imagine a word where people set it to 1 or 2. I wouldn’t want to work in that code base.
Re: Don't write clean code, write CRISP code
#68DRY is probably my least favourite programming meme. There are far too many overzealous juniors who learned it and have a bee in their bonnet about creating absurd abstractions around any two lines of code (or config) that have vague or imagined similarities, locking in all sorts of annoying indirection.
DRY only paired with the rule of three (or more)
I remember a ex-colleague of mine who copied a 1000 line function, changed a parameter, and didn't see anything wrong with it.
Re: Don't write clean code, write CRISP code
#69> Who wants to write dirty code, unless maybe it's for a porn site? Even porn sites need to write great code to handle huge traffic. I am offended by this
It's a bit of an awkward protrusion to thrust into an article that's aimed at general tech audiences. And I did wonder, reading that: IS there actually a dirty coding language for porn sites? Certainly the simplest of erections in that area could arouse some latent skill. Contributions would likely be furious. Though some annoying friction is perhaps practically guaranteed, depending on which executive discovers, in…
Re: Don't write clean code, write CRISP code
#70I’m not even joking, that’s basically my process since ChatGPT-4 has been released :) That’s a dream for boilerplate heavy languages like Go, C#, and C++.