How is it "not appropriate" ... well, actually it wasn't appropriate as the compare is against one variable, so that's switch/case's job.

But HOW is that train wreck of classes better. WHY is adding an abstract method you have to back-track through classes better than adding a CASE? It's certainly not clearer or cleaner code.

Though I hear that a LOT about CASE, and I just don't get it. How is spreading it out all over creation any better? How is saying function whatever() or making a method better than CASE "whatever":

You're making more code, spreading the logic out all over creation, and is adding a case REALLY harder than adding methods/classes?

It's almost akin to the people who undo HTML 4's progress by slopping the same presentational classes onto everything in their markup repeating it endlessly until they have 100k of code doing 10k's job, and then try to justify it by saying "DRY in the CSS". It's that same mentality of making things harder in the most convoluted and drawn out manner possible, in the name of being "easier"

I don't buy it.

Oh, and feel free to rip any of my articles to shreds. Ripping things apart and building them back up is the only way anything gets better. Down, let it all burn down. Burn it to the ground. We’ll be safe and sound, when it all burns down.

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store