Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wallymathieu opened this issue Mar 9, 2023 · 5 comments
Open

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

wallymathieu opened this issue Mar 9, 2023 · 5 comments
Assignees

Comments

@wallymathieu
Copy link
Owner

wallymathieu commented Mar 9, 2023

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

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

  • What should be same, what should be similar?

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
Copy link
Owner Author

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
Copy link
Owner Author

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 wallymathieu self-assigned this Aug 19, 2023
@wallymathieu
Copy link
Owner Author

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
Copy link
Owner Author

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

@wallymathieu
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant