Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Rethinking Best Practices

React is a different way to write JavaScript apps. When it was introduced at JSConf US in May, the audience was shocked by some of its design principles. One sarcastic tweet from an audience member ended up describing React’s philosophy quite accurately: https://twitter.com/cowboy/status/339858717451362304

We’re trying to push the limits of what’s possible on the web with React. My talk will start with a brief introduction to the framework, and then dive into three controversial topics: Throwing out the notion of templates and building views with JavaScript, “re-rendering” your entire application when your data changes, and a lightweight implementation of the DOM and events.

20.
From the Angular directives docs:
“However isolated scope creates a new
problem: if a transcluded DOM is a child of
the widget isolated scope then it will not be
able to bind to anything. For this reason the
transcluded scope is a child of the original
scope, before the widget created an isolated
scope for its local variables. This makes the
transcluded and widget isolated scope
siblings.”
http://docs.angularjs.org/guide/directive

21.
The framework cannot know how
to separate your concerns for you.
It should only provide powerful,
expressive tools for the user to do it
correctly.

22.
This tool is a React component.
A highly cohesive building block for
UIs loosely coupled with other
components.

23.
Use components to separate
your concerns.
With the full power of
JavaScript, not a crippled
templating language.

42.
“Our intellectual powers are rather geared to
master static relations and our powers to visualize
processes evolving in time are relatively poorly
developed. For that reason we should do (as wise
programmers aware of our limitations) our utmost
to shorten the conceptual gap between the static
program and the dynamic process, to make the
correspondence between the program (spread
out in text space) and the process (spread out in
time) as trivial as possible” – Dijkstra

43.
In the 90s it was easier.
Just refresh the page when the data
changes.