Better HN
topnewbestaskshowjobs
Log inSign up

leogcrespo

10 karma · joined Mar 29, 2012 (14y ago) · 2 submissions

Submissions

comment 10y ago · link · parent

Thanks for your response.

I can see how type checking helps with that in Hack, that makes a lot of sense.

Guess that in the case of Ruby for example we'd still have the same disadvantages as in JS right? Since there's still the possibility of calling methods in other modules and even in the class where the module is included, since that is discovered at runtime and you don't have any hierarchy that restricts who can call what.

comment 10y ago · link · parent

Awesome post Dan, thanks for writing and sharing!

One thing caught my attention:

>At Facebook, we extensively use traits in Hack which are fairly similar to mixins. Nevertheless, we think that mixins are unnecessary and problematic in React codebases. Here’s why.

>Mixins introduce implicit dependencies

>Mixins cause name clashes

>Mixins cause snowballing complexity

When I read these three reasons, I actually felt identified with them even outside React, since these as pretty generic problems in "mixin-like" cases that I've seen, for example Ruby modules. So it got my attention the fact that you're (at Facebook) using Hack traits successfully. Why is that? Are any of those reasons you stated not true with Hack traits? (Maybe you don't have knowledge in Hack though, but any high level conceptual idea may help).

Again, awesome post!