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

Well, usually the way to avoid a 5 pages function is by encapsulating concepts away into self-contained code. It is not by encapsulating it away into code colocated with state.

OOP is not the answer here. Class hierarchies can be, as long as they are not OOP and "classes" are just synonym for "modules".

Code and data colocation has its uses, but it's normally best fit for interface layers than internal code.



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

Search: