wallymathieu / assertfail

https://assertfail.gewalli.se
MIT License
2 stars 2 forks source link

"Copy paste programming" vs "Code Reuse Abuse" #143

Open wallymathieu opened 1 year ago

wallymathieu commented 1 year ago

https://blog.christianposta.com/design/the-cost-of-code-reuse-abuse/

https://en.wikipedia.org/wiki/Copy-and-paste_programming

https://www.johndcook.com/blog/2011/02/03/lego-blocks-and-organ-transplants/

Cop out because requirement dysplasia?

Lovingly crafted screws instead of standard ones?

When you have a hammer everything becomes a nail. Must create boat out of concrete because that is the standard mainstream building block.

https://github.com/Ghost---Shadow/i18nize-react

https://blog.codinghorror.com/the-delusion-of-reuse/

https://phauer.com/2020/wall-coding-wisdoms-quotes/

Premature duplication of code? Or what happens if you miss the abstractions that the business has, but you are stuck in details? Similar to how you can denormalise data and arrive at a solution that does not behave as the business expects?

jscpd

Can we see anything related to copy paste abuse in open source code?

Modular monolith code base:

image

eShopOnContainers:

image

SimplCommerce

image

nopCommerce

image

woo commerce

image

"Pragmatic programmer" : "The Evils of Duplication". Duplicating code means duplicating knowledge.

https://aaronstannard.com/dry-gone-bad-bespoke-company-framework/

wallymathieu commented 1 year ago

At the same time we should not see duplication of patterns as something bad since trying to avoid that duplication might lead to hard to understand code if the patterns are not thought through enough.

wallymathieu commented 1 year ago

If you look at it from a broader perspective. It is preferable for some solutions to be library methods instead of stack overflow answers. We have seen asp.net core questions end up as improvements of asp.net core. Needs a reference ...

wallymathieu commented 10 months ago

Copy paste vs wrong abstractions makes sense if you try to compress the solution without having sufficient insights into "natural" abstractions for the domain.

wallymathieu commented 7 months ago

This might somewhat be related to in the long term: https://visualstudiomagazine.com/articles/2024/01/25/copilot-research.aspx

wallymathieu commented 6 months ago

https://jerf.org/iri/post/2024/dry_strong/