DEV Community 👩‍💻👨‍💻

Discussion on: Optimize the use of if-else, you need a better selective structure!

Collapse
 
tamirazrab profile image
Tamir

I think table driven method should be must to teach during introductory teaching of programming fundamentals, students take these bad writing style along with them which is easy to spot on their code base. Sad thing is even most teacher which I've experienced aren't aware of that.

Collapse
 
akarachen profile image
AkaraChen Author

Yeah, sometimes I really wish my classmates would work on how to write beautiful code.

Collapse
 
fjones profile image
FJones

No. Please, no. Map lookups are such a silly shorthand, and more often than not they're just replacing a different structure designed for this purpose: switch/case.

Please stop telling people to use map lookups as if code golf is our goal.