Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I've seen/written 300 lines Redux reducers, which are switch statements too. Nothing wrong usually
-
rmahey5978yWhat language? You know C/C++ switch statements are actually an O(1) hash table data structure on the assembly level. Take a look at the assembly code generated
-
asgs112758y@rmahey you're right. Java does that too with an instruction called tableswitch if the case values are compact resulting in a constant lookup. If the case values are sparse, it switches to the instruction LookupSwitch which is O(log n)
Related Rants
-
LrdShaper6Came home late last night and told my wife I'm skipping dinner to take a 1hr nap as it's going to be a long n...
-
cosecamper11This week was my Boss's wedding, So had most of the week off. Took the free time to solidify my understanding...
-
devios13TFW you finally solve an issue and can close 13 browser tabs in one fell swoop.
Just replaced a 300 line switch case with a simple if statement inside a foreach loop.
Feels sooo good man
undefined
feels good