[OT] What are D's values?
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Oct 7 17:22:40 UTC 2021
On Wed, Oct 06, 2021 at 05:47:43AM +0000, WebFreak001 via Digitalmars-d wrote:
> a thing I notice from the C code where I work is that there is a lot
> of copy paste when things are done in a hurry - a thing that imo
> happens a lot less with D because of its wide set of compile time
I also noticed from the C code at my job that there's a lot of
copy-n-paste. Some of the worst instances include buggy static
functions that are copied all over the place, with the bug fixed in some
copies but not the others. IIRC there was even one instance where two
different bugfixes were applied to two different copies of the same
function, each causing it to behave differently from the other copy.
It's an utter maintenance nightmare.
This is why I love the way D lets you eliminate duplicate code and other
such boilerplate. Repetition in code is, as a rule, a code smell that
inevitably leads to later maintenance problems.
Having a smoking section in a restaurant is like having a peeing section in a swimming pool. -- Edward Burr
More information about the Digitalmars-d