http://matthijshollemans.com/2015/07/22/mixins-and-traits-in...
React: Mixins Considered Harmful
141–150 of 205 posts
Re: React: Mixins Considered Harmful
#142Earlier quoted context omitted.
No we've known and said it for a long time but not very loudly. People haven't used them sparingly and they tend to infect a codebase. Now we're just making a more concerted effort to communicate more broadly that they can be bad.
Thanks for replying -- I assume in whatever planning/architecture meetings went on before react was released that this was a measured decision you all chose to take, weighing the potential dangers less dangerous than the initial usefulness. Is this assumption correct? If you could do it again, would you leave in mixins or would you keep them out?
I think if we had to do it again (and get to keep the knowledge of the last few years), we'd probably skip mixins. We'd surely do some other things differently too though :)
Re: React: Mixins Considered Harmful
#143Earlier quoted context omitted.
Python REPL: >>> 0.3 - 0.1 0.19999999999999998 Ruby REPL: 0.3 - 0.1 => 0.19999999999999998
https://repl.it/Cbqb unless your Python compiler runs on some sort of JavaScript (-:
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.3 - 0.1
0.19999999999999998Python 3.5.1 yields the same result
Re: React: Mixins Considered Harmful
#144Re: React: Mixins Considered Harmful
#145Earlier quoted context omitted.
Python REPL: >>> 0.3 - 0.1 0.19999999999999998 Ruby REPL: 0.3 - 0.1 => 0.19999999999999998
https://repl.it/Cbqb unless your Python compiler runs on some sort of JavaScript (-:
From the documentation:
> print evaluates each expression in turn and writes the resulting object to standard output (see below). If an object is not a string, it is first converted to a string using the rules for string conversions.
I can't even find what the rules for string conversions are in the documentation :/ Oddly enough they're not described under https://docs.python.org/2/reference/expressions.html#string-...
Re: React: Mixins Considered Harmful
#146I like how core features of React are being considered harmful. First it was component internal state, now it's mixins and next thing will be the lifecycle methods. React components will then boil down to pure render functions. React will then be replaced by simpler VirtualDOM implementation. JS function declaration boilerplate will be removed from render functions, so they will be more HTML with some JS as the other…
This buzz phrase "easy to reason about" is so popular in the React world. I feel like I'm the only one who finds it oxymoronic. Especially with regard to Redux, which I think is anything but.
Angular 1/2, Ember, Backbone are all pretty "easy to reason about", so much so that it is rarely pointed out.
Re: React: Mixins Considered Harmful
#147Earlier quoted context omitted.
I added "to pick one" because I don't particularly want to start a flame thread over frameworks. Everyone can choose their own tools for their jobs. However, to the point about style guide/anti-patterns: I guess we haven't been working in the same codebases.. I've worked on a handful of different projects and most have scope flying all of the place, with controllers and directives used interchangeably (not to mention…
Well, I commented mainly because of this > There's One Way™ to do things correctly. Using anti-pattern "hacks" will work for a little bit, but in the long run come back to bite you as your software grows and scales. This is true, but in the given context that this is not true in the Angular world, that is definitely false. Some of the things you've mentioned are considered known abuses/anti-patterns/etc.
Re: React: Mixins Considered Harmful
#148Implementing mixins correctly in JS (which React does not) is already a well explored problem space. I like https://leanpub.com/javascript-spessore for great explorations and derivations of various mixin patterns. It's not that mixins are bad in general, it's that React doesn't implement them well in particular.
Thank you! The code in JavaScript Spessore is ES5-specific, but I stand by the ideas discussed, including the one central to TFA: Naïve mixins solve the many-to-many dependency problem, but not the open recursion problem. You can read the book online for free, but if you prefer the ebook format, here is a coupon for a free copy, good for today only: http://leanpub.com/javascript-spessore/c/hackernews
Re: React: Mixins Considered Harmful
#149Re: React: Mixins Considered Harmful
#150I like how core features of React are being considered harmful. First it was component internal state, now it's mixins and next thing will be the lifecycle methods. React components will then boil down to pure render functions. React will then be replaced by simpler VirtualDOM implementation. JS function declaration boilerplate will be removed from render functions, so they will be more HTML with some JS as the other…
> easy-to-reason-about redux-style state reducers This buzz phrase "easy to reason about" is so popular in the React world. I feel like I'm the only one who finds it oxymoronic. Especially with regard to Redux, which I think is anything but. Angular 1/2, Ember, Backbone are all pretty "easy to reason about", so much so that it is rarely pointed out.