Hacker News new | past | comments | ask | show | jobs | submit login

I used to feel like this before writing big and complex programs. But in term of practicality, it's a whole lot easier to just write the expansion of "rectangle" to "square" than re-writing "square" from scratch, essentially copying the majority of "rectangle" properties and functionality.



Factor out the commonality into a service class (as stated in another comment), where your common logic can be shared.




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

Search: