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

I've done exactly this where I'm just extending my code in an ugly way. Two alternative patterns to extending a function with a parameter switch are to pass in a function to the function or split the function into multiple functions around the bit thats different.

Definitely a lot harder to fix when you've done this though.

I think "the wrong abstraction" is too lofty a title this is just about oversize functions.



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

Search: