Re:Why I prefer objects over switch statements
by chris11 on Friday February 22, 2019 @01:59PM
(#19228040)
My personal preference is if-else/switch blocks with enums. Doing conditionals with string parsing just seems gross to me, but I find conditionals easy to read. And the benefits of using an enum is that you can easily find where it is used, which makes reading the code and adding or removing options easier.
[ Parent
| on HN ]
There are no comments on this comment yet.