Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IntelliJ IDEA strongly suggests to turn those Strings into constants. And then to turn those constants into an Enum. Oh wait, we could also switch() on Enum values!

I'm sure this is useful in some cases though :-)



Wouldn't it be better to configure the switch options in an xml configuration file?


I would like to vote you up for the chuckle, but this being Java, I can't tell for sure if you're joking...




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: