News for hackers. Stuff that matters.
Re:‘This’ in JavaScript by extrapickles on Thursday August 03, 2017 @01:10PM (#14921467)
Switch statements are fine for simple tasks like the one in the example, especially earlier in a project where you do not know what you need in the future. You can always switch it to the correct pattern in version 2 as that way its better understood what hidden needs the code in question has, thus making it easy to pick a good OOP patern to replace it.

Then again, my jugment might be colored by working on codebases that are >21 years old.

There are no comments on this comment yet.