News for hackers. Stuff that matters.
Re:“Clean” Code, Horrible Performance by radiator on Wednesday March 01, 2023 @12:35AM (#34979128)
Switch is not bad, far less is there any reason to hate it.
Re:“Clean” Code, Horrible Performance by smnplk on Wednesday March 01, 2023 @03:29AM (#34980031)
Agree. It's the same as saying don't use for loops or any other basic language constructs. Switch is very useful, please leave switch alone! You will not take switch away from me :)
Re:“Clean” Code, Horrible Performance by jbverschoor on Wednesday March 01, 2023 @05:48AM (#34980889)
When do you actually pass through? Only some state machines do that. But even I. That case, ifs are more clear and less error prone due to missing breaks, braces/scoping issues, etc