Skip to content

Code duplication #6142

Open
Open
@teunbrand

Description

@teunbrand

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions