Live data from Hacker News

An experienced Javascript developer’s account of learning React

medium.com

101–110 of 157 posts

Re: An experienced Javascript developer’s account of learning React

#102
post #99

Earlier quoted context omitted.

Replies like this are always interesting to me. It seems like you're saying these "overengineered" JS frameworks are useless, but I can't believe thats the case. You must just be saying they don't fit your use case, correct? If so you are not getting that point across very clearly. Otherwise are you honestly saying you can't see the use case for these frameworks? You would rebuild Facebook with static HTML and a spri…

There is a story called The Emperor's New Clothes, the morale of that story is that you should question your decisions and not blindly believe what other people say, even if you look up to them. When I saw the "light" about React, me and friend were coding our own e-commerce system each for fun. Him with Ruby and Rails and jQuery, me with Grails and React. When we implemented the shopping cart, I wrote like 200 lines…

> What I do know as a user of Facebook though, is that Facebook is annoyingly slow these days, and makes my Macbook pro fan spin at full power.

i can't echo this sentiment strongly enough

Re: An experienced Javascript developer’s account of learning React

#104
Thought I'd post this as a skim reveals no one has discussed testing.

While I am sure it is very possible to achieve this in other ways, the React-Redux structure (dumb components handling presentation and redux handling state) enforces a discipline that makes testing your client-side app far easier than other solutions I've seen where logic and presentation are far too often coupled. Recall that true vanilla ES5 does not even have modules.

There is certainly a lot of cargo-cultism surrounding React, but I'll be always be grateful for it making the vdom and functional style of coding more mainstream.

Re: An experienced Javascript developer’s account of learning React

#105
post #97

Earlier quoted context omitted.

The good part about React is that given a `messages` data structure and a `render` function, it implements `addMessage`/`addMessageBefore`/`updateMessage`/`removeMessage` on its own. Writing once and not multiple variants of the same is good. Another good thing is that that there are a lot of components someone already published, that are ready to use (immediately, or after a few small fixes/PRs). The bad part is tha…

all the add/remove list stuff can be implemented by a simple templating library (handlebars/mustache) which doesnt mess up the whole client side architecture

Oh, no, I'm sure that's incorrect.

Templating libraries can't update documents, they can only overwrite them completely. This either loses state (entered-but-unsaved text, cursor positions, collapse status, etc.), or requires a lot of watchers and extra state information.

Those DOM updates is the whole point of React.

There are other libraries that work in a similar fashion, but React has more traction thus reusable components and recipes available...

Re: An experienced Javascript developer’s account of learning React

#106
post #17
post #2

React popularity seems to me the result of wrongly-headed thinking: that because facebook is popular, any technology behind it must be good, and because react is popular (allegedly), react must be good. I've always been very sceptical of react, and I'm glad I didn't invest too much time looking into it, as it seems both a time sink and a boilerplate-filled approach. I wonder why some people like it, writing no-framew…

I am working on a web application that is dynamic enough that the standard way to build websites makes it really hard. So I started building my own version of React. Found React some time later and switched because it was better than my crappy code. Why was I trying to build React? I wanted a framework that behaved more like a video game render loop or a desktop UI framework. I wanted a framework where I could simply…

> I wanted a framework that behaved more like a video game render loop

I had that thought the other day, apparently it's not so novel after all! Does anybody know of other frameworks that take this sort of approach?

Re: An experienced Javascript developer’s account of learning React

#107
post #80
post #72

Earlier quoted context omitted.

No adding/removing/modifying elements in a list is very simple and fast, even with thousands of elements. Example: https://pastebin.com/Fu39i47z

jasim isn't complaining about performance, but about the complexity of the code.

Parent's paste bin is ~40 lines of code (with white space) consisting of 4 functions, with what? 4 loops.

If you consider 40LOC complex I don't understand why you work as a dev.

Re: An experienced Javascript developer’s account of learning React

#108
post #97

Earlier quoted context omitted.

all the add/remove list stuff can be implemented by a simple templating library (handlebars/mustache) which doesnt mess up the whole client side architecture

Oh, no, I'm sure that's incorrect. Templating libraries can't update documents, they can only overwrite them completely. This either loses state (entered-but-unsaved text, cursor positions, collapse status, etc.), or requires a lot of watchers and extra state information. Those DOM updates is the whole point of React. There are other libraries that work in a similar fashion, but React has more traction thus reusable…

no, the point of the template engine is not to push all the logic into the templates. as you say you still handle the state yourself. the template render just skips the messy output building step, which for many cases is all you need

Re: An experienced Javascript developer’s account of learning React

#109
post #44

Regardless of these complaints, the job market for React is just too damn good to ignore. I bit the bullet and began learning. As a newbie, I understand the sentiment of this article. However, it's really not as bad as the author makes it out to be. Also, className instead of class took all of 3 seconds to learn.

Also `class` is a reserved word in JavaScript, author doesn't even notice this.

As mentioned in other comments, I don't have this issue of not being able to use `class` in Vue. So it can be done better.

Re: An experienced Javascript developer’s account of learning React

#110
post #65

Earlier quoted context omitted.

You'd include all the modules as separate script files. Each script file is a revealing module[0] that exports its API to a global variable. If you're interested I could put together a more complete boilerplate. I don't actually use this approach much in front-end work these days, but it can be nice to work with just text editor and browser. As for building it, you're on your own. You could run jsx from the command l…

I may be wrong, but I use webpack to remove exactly the the pain point of running jsx from the command line, concatenating files and minifying them. It does good job there and saves me time.

It's a good solution, but webpack can be overwhelming to newcomers, and it sometimes can lock you into working with associated dev tools like webpack-dev-server and all the various loaders.
Post reply on HN