DEV Community

loading...

Discussion on: Probably the hottest code refactoring you ever saw 🔥

Collapse
aleksikauppila profile image
Aleksi Kauppila

Thanks for posting Ioannis, good job!

You can take this to the next level with Replace conditional with Polymorphism. Even though you have successfully improved the code in this example, every new format will require you to modify this algorithm.

Collapse
potouridisio profile image
Ioannis Potouridis Author

Great! Thanks for sharing.