Single-use function parameter enums #4792
Replies: 3 comments 3 replies
-
Every enum begins as something only needed in one place. But I'm unconvinced that any enum stays that way for long. For example, |
Beta Was this translation helpful? Give feedback.
-
You're using it more than once in your program, at the site where it's declared and at the site where it is called. |
Beta Was this translation helpful? Give feedback.
-
Why not have : GreetSpanish, GreetEnglish, etc.? I don't get the point of the enum that the caller had to use to customize behavior where the impl just switches on it. Why not just avoid the indirection? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For when you need an enum for a function parameter but will only use it one time in your program.
Beta Was this translation helpful? Give feedback.
All reactions