3 ms·
Love this book, the flow, the levels, and the rhythm! The only thing I stay apart from, is the implicit approach of ES6. IMHO, explicit is better than implici
by tzury 10y ago
Love this book, the flow, the levels, and the rhythm!
The only thing I stay apart from, is the implicit approach of ES6.
IMHO, explicit is better than implicit. Therefore:
return (<div>...</div>)
Is better than
{
<div>...</div>
}
and
this.state = { list: list };
Is better than
this.state = { list};
Everyone these days seems to take the implicit ES6 way though.
- rwieruch 10y agoThanks for your honest feedback! I agree with your opinion. But at some point I had to make a decision how to address the ES6 topic. In the end my opinion was that you can't get away from learning ES6. Personally I learned ES6 on the way when I picked up React. It felt just natural and I hope that the readers will do so as well. Still I tried to cover most of the code pieces in an explicit way before I do them more implicit. But I have to be honest that I didn't thought about (<div>...</div>) vs { <div>...</div> } :)
- bryanrasmussen 10y agoWell, explicit is better than implicit when there is a very real chance of missing the implicit, especially when just going over the code quickly. The return example is a good case of this, reading over code you can easily miss that those particular brackets are supposed to be a return. I think though that this.state = { list}; is just as easily understandable as this.state = { list: list }; once you are familiar with the syntax, and may be even more easy to understand due to the being easier to read.