-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
Description
In many places we use bool parameters to denote some effect.
I suggest that throughout the codebase, we make an effort to (where feasible/touched) replace these with enum class.
It's a bit more verbose, but it's already a norm to do f(/* confusing bool */ true), and it would be nice if our compiler helped us out.
Further, it makes it easier should later code extend the functionality to add more/different options.
In order to reduce clutter we could make a macro BoolEnum(Argument, EnabledName, DisabledName)
Not high importance, so I don't think we should make a project out of it, but I was looking at some code recently where it would have been nice.
Con: we don't need more structs.
practicalswift