For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more hicksyfern's commentsregister

I don't think you've really read and understood the notion of function composition. All you're talking about here is having objects as properties of other objects - that is not function composition.


I'm not asking about function composition, I'm asking if there is any basis for disliking inheritance other than the fact that it is currently trendy to do so.


There’s something I’d like to clarify.

The article you are commenting on is about avoiding mixins in React components. It is not a general statement saying “Always use anything called ‘composition’ over anything called ‘inheritance’”.

We found that inheritance doesn’t work well for React components. And we found that composing React components with React’s composition model (which has very little to do with object composition) worked well for us.

Nowhere do we claim that object composition is better than object inheritance, or something else generic like this.

(Sorry if you didn’t interpret it this way. I just want to make it clear for future readers that this branch of discussion is not related to the contents of the article.)


Currently trendy?

https://en.wikipedia.org/wiki/Design_Patterns#Introduction.2...

I wouldn't consider 1995 current. And it's gone way beyond "trendy".

EDIT: Also, what you've mentioned there is not composition - it is objects that have other objects as properties. Composition basically involves wrapping and forwarding, whether it's function or object composition.


We have a Cordova app that begins on a local web page then immediately redirects to a remote page, and we have recently had a bunch of users on iOS 9.3 complain that they are just stuck on the first screen.

So it looks like it probably does affect Cordova apps.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search:

HN For You