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

Another big one. For Object oriented code. Composition over inheritance. It's hard to overstate how important this is. Many people know this but still don't do it enough.

Don't make large classes that implement many features. Split those features/responsibilities into smaller classes and then have a class that calls to the smaller ones.

A good way to think about this is your classes should have as few member variables as possible.



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

Search: