Hacker News new | ask | show | jobs
by sametmax 2914 days ago
I like your answer.

You should start with a very long, nicely sliced in small chunks, tutorial begining with script tags and react.create element, followed by a step by step ramp up to babel/webpack integration and only end by demonstrating create-react-app as a way to do all that automatically and more.

Not the other way around.

I get the wow effect is sexy, but it's pedagogically backward. Or at least just use it to show off, then use the momentum to motivate the reader to start from scratch.

The hello world should just say hello, and how the same code in pure html, and then in vanilla js.

Also, while progressing, you needgo from tighly coupled monolitic components to clean reusable decoupled ones, illustrating common patterns little by little.

Yes, it's tempting to do it correctly the first time, and faster. But it's mixing several things to learn at the same time, which makes things a lot harder to grasp.

At last, the tutorial should start using es5, and introduce new es6, 7, and stage 3 stuff on the way, next to the matching babel config and typical use cases. Particularly imports, spread, arrow function and destructuring. You must understand: this week i was hired to give yet another react training. The students didn't even know what the dom was. It's very common.

A bigger app than a todo list should be achieved in the end, and it should, in it's very final state have an opiniated by the book ajax and router setup, plus a friendly way to share the state without going full blown flux. Then conclude, opening to other options, including but not limiting to a word on redux and mobx.

Yes, a good doc write about other tech. It's irritating, i understand. It's not your job after all. But django has a section explaining how to configure nginx and apache. They get that it's part of the experience.

A separate section should be dedicated to integration with popular frameworks in other languages such as ror or django.

All in all, it should not assume people are advanced js dev nor that they are familiar with the js ecosystem. Many new comers come from other languages and run npm for the first time.

This would make the official tutorial 10 times larger at the minimum. It's a good thing, but people looking for a quick reference would be annoyed. So you also need to keep the current version around, which is the short story and is great when you already know what you are looking at. And make explanations about js and its ecosystem in optional sections to avoid borring people that already know the stuff.

Two more additions are nessary.

One is a glossary you should hyperlink from everywhere in the doc.

Two are schemas showing off things like data flow, components life cycle, relation between the dom and virtual dom and rendering, main functions mapped to main use cases, etc.

It's a lot of work, i known. I wrote tons of those. It takes months. But that's the only way to get a great doc. Besides, react is not a simple tech despite what every tutorial says, and a lot of magic hide the "it's just javascripy" so people get confusew.