Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

switch is example of explicit control flow, which Clean Code argues strictly against.

the better approach would be to use implicit control flow using class hierarchies, interfaces, and such and rely on class behavior, polymorphism and runtime dispatch, instead of explicit switch() which tends to multiply itself across the codebase

 help



You accidentally used the phrase better approach, instead of Clean Code.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: