Live data from Hacker News

Removing User Interface Complexity, or Why React is Awesome

jlongster.com

171–180 of 228 posts

Re: Removing User Interface Complexity, or Why React is Awesome

#171
post #62
post #29

As mostly an outsider to the web front end development, React.js is probably the easiest one for me to understand among the typical "frameworks", especially Angular and Ember. After all the excitement about Angular for example, I went to learn about it and just got lost with new concepts: DOM transclusion, scopes, services, directives, ng-apps, controllers, dependency inversion and so on. I can use it but need someon…

> After all the excitement about Angular for example, I went to learn about it and just got lost with new concept DOM transclusion, scopes, services, directives, ng-apps, controllers, dependency inversion and so on. I can use it but need someone to hold my hand. It reminded me of Enterprise Java Beans. AngularJS has a serious "naming" problem. Most these concept are easily understood when explained the right away,wha…

I agree. It takes a while to get one's head wrap around AngularJS. But once you get it, it's awesome. Anyways, this is the tutorial that finally helped me get it:

http://www.thinkster.io/angularjs/GtaQ0oMGIl

Re: Removing User Interface Complexity, or Why React is Awesome

#172
post #62
post #29

As mostly an outsider to the web front end development, React.js is probably the easiest one for me to understand among the typical "frameworks", especially Angular and Ember. After all the excitement about Angular for example, I went to learn about it and just got lost with new concepts: DOM transclusion, scopes, services, directives, ng-apps, controllers, dependency inversion and so on. I can use it but need someon…

> After all the excitement about Angular for example, I went to learn about it and just got lost with new concept DOM transclusion, scopes, services, directives, ng-apps, controllers, dependency inversion and so on. I can use it but need someone to hold my hand. It reminded me of Enterprise Java Beans. AngularJS has a serious "naming" problem. Most these concept are easily understood when explained the right away,wha…

As the famous quote goes, there are two hard things in computer science: cache invalidation and naming things. When I first heard it, I thought it was a joke; nowadays I feel like it's barely a simplification.

Re: Removing User Interface Complexity, or Why React is Awesome

#173
Curious if anyone has experimented with Go+React - specifically rendering on the server side as well. Similar to Rails / react_ujs (react-rails gem), seems like you would need to provide Go with access to a v8 runtime and a FuncMap helper in the template to call for the necessary component (JSX -> markup). I've really enjoyed React and I've enjoyed Go in my spare time, but I still find myself using npm for a lot of the, um, grunt work.

Re: Removing User Interface Complexity, or Why React is Awesome

#174
post #116

Earlier quoted context omitted.

I understand that there are sometimes practical reasons for not being able to use ClojureScript, but have you given it a go? It's really very, very nice (much nicer than JS in pretty much every way). * Immutable data (you can get some of this in JS with Nolen's Mori http://swannodette.github.io/mori/ ) * Better functional programming than Underscore (map :mykey some-objects) * Great syntax: homoiconicity, thrush oper…

I've been trying to move towards ClojureScript for a while, but there are so few introductory resources out there that allow you to navigate between the Clojure world and the JavaScript world in a way that makes sense to people who come from JS backgrounds exclusively. I wish OReileys would issue an expanded version of their Intro ClojureScript book!

I've been learning CLJS for a couple months. Here's a syntax guide and a list of resources I've used: https://github.com/shaunlebron/ClojureScript-Syntax-in-15-mi...

Re: Removing User Interface Complexity, or Why React is Awesome

#175

Earlier quoted context omitted.

Thanks for the rational response, Tom. I hope this doesn't get buried (someone is going through and downvoting at least all of my comment to 0). Blog posts are best when they are sensational, and I try not to overdue it. I think React has a lot of good ideas, but "revolutionary" is a strong word. I think "refreshing" is a better word. Regardless, I think both React and Ember are the best 2 solutions out there right n…

I think this technique is really cool but I thought I should point out that although continuous rAF makes it easy (you can set state directly), on but FF and Chrome on my machine, even when your page appears to be completely static it's consuming 10-20% of CPU constantly. That's got a couple of issues. 1. It eats my battery 2. It DoSes my machine (10-20% not available for other things) So, please don't do that. Set a…

it's consuming 10-20% of CPU constantly

It appears you're using a multicore machine with between 5-10 cores. A continuous loop is basically going to keep one core at 100%, which is only a bit of an annoyance with a multicore, but on a single or even dualcore machine (e.g. low-end mobiles), it will make everything else slow to a crawl.

It's interesting to note that, were this done several years ago or earlier, it would only make people complain about how your site froze their browser, but now we barely notice a single core running at full load unless we're observant...

Please use computing resources responsibly.

Re: Removing User Interface Complexity, or Why React is Awesome

#176
post #49

Tester: The UI is wrong right here... Developer: Hmm...I wonder how long it's going to take me to figure out where that HTML was generated in my javascript.

You hit the nail on the head why these things are bad. You can either build something on a mass production line, where you're just screwing the same bolt in day in and day out, or become a master craftsman and build it with proper care, design, and quality. These frameworks are nothing more than a factory floor and if all you do is build apps with a framework you're little more than a paid glue stick piecing bits of…

React is a paradigm with only one existing implementation.

Ranting against frameworks represented by React is a strawman here. It doesn't include a router, nor a model layer, nor the traditional controller. It's a miracle that it's even compared to Angular and Ember, but I guess that's the extent of the power of View + solid declarative nature, so we'll take it as a compliment.

We also don't want to turn it into a huge framework, so if that's your only concern here, then please feel free to give it a try =).

Re: Removing User Interface Complexity, or Why React is Awesome

#177
post #118
post #41

Has anyone tried to use a different template engine with React? I was just wondering, since I didn't want to use JSX inline, and writing out html with React.DOM isn't appealing either. I just wanted a way to put templates in tags that get loaded by React Components. That way, I won't be mixing templates and the behavior of the components. Has anyone done this before?

There's this: https://github.com/mereskin/jsxify But really, once you get used to keeping everything together it really does feel better . You just have to try it out. Personally, since I use CoffeeScript, I like this lib: https://github.com/atom/reactionary which, since it strips out the required `null` or `{}` first parameter, feels very much like haml or jade.

I use coffeescript too, so I should be able to use reactionary to write the dom helpers it exposes in my JSX. So then the coffeescript -> jsx on server side, then jsx -> javascript browser side, is how it works, right?

I think I'm slowly being convinced putting it together in the same file makes sense, since it's a single component, and the what's being displayed is coupled with what you'd do with it, so I guess it should belong in the same place?

Re: Removing User Interface Complexity, or Why React is Awesome

#178

Tester: The UI is wrong right here... Developer: Hmm...I wonder how long it's going to take me to figure out where that HTML was generated in my javascript.

Developer: use React.js. Events go one way only, no funky feedback loops between views, models and controllers.

Re: Removing User Interface Complexity, or Why React is Awesome

#179
I experimented with React a bit but I was a bit bugged by how large it was. The basic idea of rendering to a virtual DOM and having unidirectional data flow is really simple but I had trouble actually diving in to React's source code and seeing things under the hood (for example, I had to find a blog to see how the diffing algorithm worked).

What are the other libraries out there that we can use for this virtual DOM pattern right now? I only found mithril[1] that similarly does the template rendering with Javascript but I still don't know how different to React it is in the end? Is the diffing algorithm similar? Do they handle corner cases the same (many attributes need to be treated specially when writing them to DOM)?

Simplifying it a bit: other than the virtual DOM, is the rest of React also the best way to structure apps? What would the ideal "barebones" virtual DOM library look like?

[1] http://lhorie.github.io/mithril/

Re: Removing User Interface Complexity, or Why React is Awesome

#180
my gripe with those is that you remove UI complexity but shove usability and accessibility over some dark orifice.

All those things are cool for social apps (a.k.a. fart apps) but for business ready platforms this is just silly.

for example, a link that i can middle click or bookmark or send to someone, etc would be much more useful even if not as spiffy as those scrolls

Post reply on HN