Hacker News new | ask | show | jobs
by drieddust 3224 days ago
Agreed and there is no reason to still stick with react when alternatives like vuejs and angular are available.

Its not that great anyways when compared to angular 2/4. There are too many concepts to be mastered and it soon become overwhelming. I tried learning react but dropped it after spending a week when I still could not understand routing. Sense of cohesiveness between different concepts is missing. I believe some learning junkies may get the kick out of it but that's not me. My time is better spent elsewhere.

Angular on the other hand introduces everything one single tutorials[1] to make one productive. Deep dive later can be done later on when required.

[1] https://angular.io/tutorial

Edit: minor typo

6 comments

React Router v4 is dead simple: https://medium.com/@pshrmn/a-simple-react-router-v4-tutorial...

It's just React components up and down.

Most of the concepts that you must learn with React have to do with understanding JavaScript. If you know JS, you know 80% of what you need to know.

It's also less capable and completely incompatible with router 3.
I hadn't heard that it was less capable. But you can always keep using v3 if that's what you know. He seemed to indicate that it took him a week to figure out routing in React. I have never had that much trouble.
> He seemed to indicate that it took him a week to figure out routing in React. I have never had that much trouble.

When you haven't had "that much trouble", it sounds like you're calling them stupid or a liar, and it sounds like you didn't consider the possibility that you're working on a very different problem or have a different definition of "figure out routing".

I store all of my user state in the URL. This way users can copy URLs to each other containing their state, I can press reload to debug things, Other people can embed portions of my application into iframes, and other good benefits.

However I don't want to sprinkle url changes and parsers all over my code, so I'd like to hook into the router system and glue it into the property system. I've probably been through a few versions of this idea with react and certainly spent at least a week in total trying to get it working well with all the different browsers and widgets, only to have react-router 4 come out and break it.

I then probably spent at least a day or two looking for similar-shaped hooks and couldn't find them. Maybe I should have spent more, maybe I should've been smarter.

However I note that the author of React-router took four very different approaches towards figuring out routing and produced incompatible APIs, which is a strong sign that they weren't able to figure out how routing should work either.

No, it's simply that OP did not clarify with any specific problem he had with React Router.

If React Router is not suiting your needs, there are many other options out there. That's the beauty of the ecosystem:

https://github.com/FormidableLabs/redux-little-router https://github.com/react-community/react-navigation

I'm glad that even React Router was willing to iterate on its implementation.

It takes a couple of hours to do a bit of research and searching to find the solution that fits your needs best.

Is there are reason you're not considering angular?

I feel like I'm missing something big with everyone not even talking about angular. Maybe I feel this because Angular was big and then soon it wasn't. Probably that's the disconnect

Same here, This all seems like a "My JS Lib is better than your JS Lib" fight. So let me say this, React is by far and away the best JS view library out there. I don't need MVC in my fucking view(Hey Ember), and I don't need a entire framework for my view(Hey Angular)..

ReactJS 4tw.

React Native is what I believe to be the big thing in the React community. I haven't hear of anything similar in the Angular or Vue ecosystems.
https://weex.apache.org/ is the closest thing for the Vue ecosystem
As an alternative, albeit in a different language, is Google's Flutter[1]. If Google can correctly capitalise on this moment in the React.js ecosystem, they could really come to dominate in cross platform mobile app development.

[1] https://flutter.io/

NativeScript is really good
I've been using NativeScript with Angular and I like it
React doesn't do routing. It's a view library.

And for me, the opposite was true vis-a-vis Angular and React, though got as far as making contributions to the Angular 2 tools before I decided to jumping ship.

> React doesn't do routing. It's a view library.

and that's the problem. React itself solves a tiny subset and delegates the other responsibilities to different tools which may not align with each other. Most of the is spent is wiring making different choices and wiring them together.

On a side note what made you move away from Angular 2 to React?

> and that's the problem. React itself solves a tiny subset and delegates the other responsibilities to different tools which may not align with each other. Most of the is spent is wiring making different choices and wiring them together.

So modularity is a problem now?

well there is modularity and then there's keeping frequently used things together. I think react push modularity at the cost of productivity (opinion).

It's like breaking a kitchen knife into two: the blade and the handle, in the name of modularity.

Concretely, this is what I mean: Routing, and a bunch of other things are used together, it would've been better if react had kept the view library separate but also maintained an official router among other things

Routing isn't always necessary, if you're building server rendered pages and a non-SPA web app. Facebook isn't a SPA, so that's why they never built and subsequently released a router. They generally only open source and release things they use in production.
What's the problem with solving exactly one problem (and doing it fairly well). I'd rather have the possibility of choosing which routing library or state management and swap things as I see fit, than being locked in with whatever the framework chooses.
That's the problem, it isn't intuitive at first as to how one should add routing when using React. I learned React-Router, but the API has changed a lot between versions in the past.
You can't blame a tool for the shortcomings of another tool, though :)

Fwiw, I concur that React Router is/was a bitch (it's been a while) - I suffered through it too. A client-side hash-based router is ~10 lines of javascript, and is what I'll write unless there's an actual need for anything more.

Angular is nothing like React. It's garbage in comparison.
In what sense?
I'm not getting the angular hate. Would you want to explain why?
Just my opinion from working with them everyday. Angular is more of a monolithic beast attempting do everything, and mostly it can. React is more of a microorganism with one goal, which it excels at. For me, Angular feels heavy, especially since the introduction of NgModules. I guess the million breaking changes that occurred from AngularJs to Angular2 might have left a bit of a sour taste in mouth, regarding the framework. How can they introduce NgModules in like beta 10? Angular isn't a bad framework, but the question goes down to would you rather have one framework that try to do everything, or many frameworks that each try do their one thing. There are pros and cons to both. On an even more opinionated note, I really enjoy the syntax, and feel of React(jsx)... which something I don't get with Angular components. I'm not even gonna start on redux, but it's pretty fun when you get the hang of it. As with a lot of things in programming but each to their own.
Angular does not come with a patent grant at all. Vue most likely is infringing on FB patents anyway. So what is the win exactly?
> Vue most likely is infringing on FB patents anyway

There are zero known patents related to react.

So what patents FB grant is related to?
In that case, the patent clause in the React license has zero effect.
Mmm, well it widens the range of people using software declaring their patent grant, which applies to all their other patents as well.
Angular 2 is MIT licensed. Why you need a patent grant anyways?
because copyright and patents are orthogonal concepts. FB gives you patent grant with restrictions Google does not give you a patent grant at all.
The patent grant is (presumably) implied by the act of licensing under MIT in the absence of other specific restrictions (such as Facebook's PATENTS file as an explicit patent grant with one-sided limitations).

See for example: http://oss-watch.ac.uk/resources/fossandpatents "Some free and open source software licences also explicitly grant the patent rights necessary for the purposes of using, adapting and distributing the code, for example the Apache License v2, the GNU General Public License v3 and the Eclipse Public License. In some jurisdictions, including the UK, it is highly probable that even those free and open source software licences that do not explicitly grant patent rights do in fact provide them implicitly. After all, giving permission to perform a specific act strongly implies permission to perform the steps needed to do so. Thus the permission to redistribute the software granted by all free and open source licences - it can be argued - implies the granting of the right to make use of any of the licensor’s patents which would be infringed by the distribution of the code."

The big question about an implied patent license would be whether or not it is revocable.

In the specific cases of the BSD and MIT copyright licenses note that the licenses do not say that they are irrevocable. A license granted for no consideration is generally revocable unless it specifically says that it is not.

There are substitutes for consideration. It is an open question as far as I know whether or not those apply in the case of free software and make licenses like MIT and BSD irrevocable.

If you use BSD or MIT licensed patented software that does not come with an explicit patent grant, you'll have to deal with these arguments if the patent owner decides to go to court:

1. There is no implied patent license,

2. If there is an implied patent license it is revocable and they revoked yours,

3. The copyright license is revocable, they revoked yours, and that implicitly revokes the implied patent license (even if it is irrevocable normally).

It's so much safer to try to stick to licenses that say they are irrevocable and include an explicit patent grant.

"It's so much safer to try to stick to licenses that say they are irrevocable and include an explicit patent grant."

Sadly, although Facebook includes an explicit patent grant, it does not claim to be irrevocable. They even list one specific case where it can be revoked.

Nice if you are in UK, but a very small % of tech companies is in UK.
vue and angular don't offer the same typing guarantees as React.

Though I use Angular in my day-to-day, I would really love to be in React land for that reason alone. I've had too many interface bugs due to simple template typos

How come? Angular is Typescipt first so typing guarantees are builin.
Not in templates.
You need to use the Angular Language Service extension for vs code, it works perfectly giving you full type completion and error checking in templates https://github.com/angular/vscode-ng-language-service
Thanks for sharing this.