ggplot2 icon indicating copy to clipboard operation
ggplot2 copied to clipboard

Code duplication

Open teunbrand opened this issue 1 year ago • 0 comments

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 avatar Oct 17 '24 09:10 teunbrand