Skip to content
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

Code duplication #6142

Open
teunbrand opened this issue Oct 17, 2024 · 0 comments · May be fixed by #6143
Open

Code duplication #6142

teunbrand opened this issue Oct 17, 2024 · 0 comments · May be fixed by #6143

Comments

@teunbrand
Copy link
Collaborator

A lot of ggplot2 code is boilerplate code, that is, repeated section of code with little to no variation.
Think of all the geom_*() or stat_*() or scale_*() constructors, which are all very similar.
It seems to me that this pattern of duplicated code is susceptible to accruing tiny inconsistencies.

Probably, a lot of this code could be generated (semi-)automatically. This would:

  • Reduce duplications
  • Decrease inconsistencies
  • Be easier to maintain
  • Be beneficial for extensions too

Notably #5484 started replacing a lot of duplicated scales_*() code, but I don't think this is systemic enough.

@teunbrand teunbrand linked a pull request Oct 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant