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

You can just do both, though. Use interfaces for polymorphism, to define the interactions between your objects -- and then, if you want, use inheritance as one possible strategy for code reuse.


That works great if you're only using one interface in your class. What if you need to include two?


Then you use a different reuse strategy, like composition. The language is not ideal in this regard, certainly.




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

Search: