Live data from Hacker News

Opinionated Comparison of React, Angular2, and Aurelia

github.com

81–90 of 169 posts

Re: Opinionated Comparison of React, Angular2, and Aurelia

#82
post #29

I've spend a lot of time evaluating Angular + Ionic, Vue and React. My goal is to rewrite my webapp as a SPA with complimentary mobile apps. Maximum code sharing would be nice. I'd like to add to the discussion what I learned and also add Vue for comparison. Vue felt less intimidating at first, whereas React seemed to be overly complicated. Truth is, both are actually quite similar. The problem is that every single t…

"The main advantage of React over Vue and Angular is: React Native. Vue doesn't have anything close to it." Have you tried Quasar? ( http://quasar-framework.org/ ) We're using it right now for a customer project and I'm very happy so far. Performance feels better than Ionic2.

I haven't tried it, because the components don't look native. Buttons with text that have a shadow? What on earth is that? It looks less polished than Ionic and suffers the same problems of all Cordova-based hybrid apps: No native input controls. For me, this is a dealbreaker.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#83
post #29

I've spend a lot of time evaluating Angular + Ionic, Vue and React. My goal is to rewrite my webapp as a SPA with complimentary mobile apps. Maximum code sharing would be nice. I'd like to add to the discussion what I learned and also add Vue for comparison. Vue felt less intimidating at first, whereas React seemed to be overly complicated. Truth is, both are actually quite similar. The problem is that every single t…

> The beauty of React is that it forces you to think in a slightly different way. Vue seemed more accessible for a spaghetti code writer

This has been my experience too with React and Vuejs. React requires thorough planning beforehand to write good code. You need to plan the parent-children structure before you jump in. It's easy to write shitty code in react too if you jump in headfirst; resulting in the kind of "enterprise boilerplate" others are talking about in this thread. Personally, I am happy with React at the moment (and React Fiber let's you return an array of components, so no more wrapping your components around a span - yay!).

Re: Opinionated Comparison of React, Angular2, and Aurelia

#84
post #82

Earlier quoted context omitted.

"The main advantage of React over Vue and Angular is: React Native. Vue doesn't have anything close to it." Have you tried Quasar? ( http://quasar-framework.org/ ) We're using it right now for a customer project and I'm very happy so far. Performance feels better than Ionic2.

I haven't tried it, because the components don't look native. Buttons with text that have a shadow? What on earth is that? It looks less polished than Ionic and suffers the same problems of all Cordova-based hybrid apps: No native input controls. For me, this is a dealbreaker.

Cordova is all about plugins. You can use a native datepicker plugin for example.

If you need native functionality, use a plugin. (there's probably one already there, but maybe you need to write a tiny bit of native code).

I guess that's the whole point of hybrid that people don't understand - it's a hybrid, and you get to choose the best of both, making the trade offs you need to make for the best result.

Not ideal for every app/budget, but I think people just don't get this part - use the native plugins if you need them! :)

Ship fast, and slowly replace all the bits with native (if you need to). [fast|cheap|good] pick two! (then the third).

Re: Opinionated Comparison of React, Angular2, and Aurelia

#85
post #75
post #71

Earlier quoted context omitted.

JSX is not a template language, it is just syntax sugar: see it as a different way to write javascript: https://facebook.github.io/react/docs/jsx-in-depth.html you can't say the same about templates.

It's not JavaScript, and it mixes in almost-html... but it's not a template language? Wrong. It's a template language, even if Facebook tells you otherwise.

It really isn't a template language as the term is commonly used. If you feel so strongly about the weird syntax you can write equivalent code in javascript syntax instead.

  return React.createElement(
    button,
    { className: "square", onClick: () => this.setState({value: 'X'}) },
    this.state.value
  );
If you think your code is written in a template language, then the code I just wrote must also be written in a template language (with different syntax).

Re: Opinionated Comparison of React, Angular2, and Aurelia

#86

The ending is what makes this article: >Overall, I'm not 100% sure I made the right choice, but I only have to live with it for two years. People are great at short term thinking, and tend to be terrible at long term thinking. Just some anecdata: I had a look at some source code for a 10+ year old web app before JS libraries were popular. I could understand perfectly how a click on a link resulted in a URL hash chang…

Don't worry, the simpleness and adequateness of plain old JavaScript (+ maybe jquery) and basic web techniques is re-discovered like every 5 years. Right now, we're at the height of the React hype cycle which just means we're approaching its imminent downfall due to generational forces (though I still do like some aspects of React specifically).

Sorry to sound defaitist, but like you say, the goal of React (and AngularJS, vue, ...) is to simplify web frontend development and improve maintainability. But these cost benefits are offset by their (absurd, IMHO, for most use cases) upfront complexity and thus can't possibly be attained within two years. Also, the desire to work in an agile fashion where everybody should be able to do everything (back- and front-end work) works against expert/thermonuclear front-end development tools.

Re: Opinionated Comparison of React, Angular2, and Aurelia

#87
post #53
post #29

I've spend a lot of time evaluating Angular + Ionic, Vue and React. My goal is to rewrite my webapp as a SPA with complimentary mobile apps. Maximum code sharing would be nice. I'd like to add to the discussion what I learned and also add Vue for comparison. Vue felt less intimidating at first, whereas React seemed to be overly complicated. Truth is, both are actually quite similar. The problem is that every single t…

Isnt Redux about using components to dispatch actions, and all the logic happens in the reducers for the store? So, the Model part is not inside the react view components which are just used for display. If you have uncontrolled components(React terminology for forms with extra data not handled by props), then form validation might require some processing in the components.

Partially, you're right. Some logic happen in reducers, but not all, because they must be pure. For example, you can't call new Date() in a reducer, because it's not pure.

Imagine you have a TodoList with Items that have: a priority and a createdDate. TodoList is always sorted by 'priority, created DESC'. There's also an email service that gives you a high-level overview of the TodoList like so:

  High Prio (3 items)
  Mid Prio (1 item)
  Low Prio (0 items)
  Total: 4 items, last created: 2017-04-07 11:38
This email is sent out whenever a new item is added.

So, your business logic is like this:

If a user creates a new TodoItem:

- You need to get the current date (unpure, so this must come from an action creator [1])

- You must update the "entity" of TodoList and sort and recalculate its summary

- This summary must be send out as an email

Or to sum it up: You have an action that triggers a bunch of totally unrelated side effects. This has nothing to do with the state of the View, which Redux manages. But it's still important business logic to this app.

The question now is: How do you manage that? Because this clearly must be outside of React and Redux. Some people just slap other libraries on top, but I never found a satisfactory explanation on how to implement such workflows "properly".

Too many tutorials are way too simple and gloss over these details.

[1]: http://stackoverflow.com/a/34135166/

Re: Opinionated Comparison of React, Angular2, and Aurelia

#88
post #57

> There are a few more frameworks I would have loved to try, including Polymer and Vue.js. There just wasn't enough time to do a deep dive with all of them. I hope he gives Vuejs a try. As a javascript beginner, who tried Angular, Angular2, A bit of React and VueJS, I just loved the flexibility and approach of VueJS. I was instantly productive thanks to the amazing documentation and vue-cli that just worked out of th…

The vue looks good. Yeah, Vue.js is for people who make things. React is for enterprises who don't seem to mind being 3 months late shipping basic stuff. In react everything is done in the template language. It's a sort of reverse template language, that doesn't even really use proper html for things. So weird. Vue is just all together, and is based on web standards. Not a weird thing by facebook enterprise developer…

> React components aren't. They tell you to move state from the child to the parents.

You don't have to do that if you don't want to - I don't in the react I write. Is there anything special about vue components which would allow you to keep state in child components in vue but force you to move the state to parent components in react?

Re: Opinionated Comparison of React, Angular2, and Aurelia

#90
post #84
post #82

Earlier quoted context omitted.

I haven't tried it, because the components don't look native. Buttons with text that have a shadow? What on earth is that? It looks less polished than Ionic and suffers the same problems of all Cordova-based hybrid apps: No native input controls. For me, this is a dealbreaker.

Cordova is all about plugins. You can use a native datepicker plugin for example. If you need native functionality, use a plugin. (there's probably one already there, but maybe you need to write a tiny bit of native code). I guess that's the whole point of hybrid that people don't understand - it's a hybrid, and you get to choose the best of both, making the trade offs you need to make for the best result. Not ideal…

So, the idea of Ionic/Cordova is: You can release an app without writing native code. Your suggestions certainly work, but they bring up questions:

- How do I write the native code you mentioned?

- How do I plugin the native datepicker in Ionic?

- How do I deal with different native plugins for iOS and Android?

I bet there are solutions for all of these problems, but then again, I might just want to consider React Native, because Ionic doesn't bring any more benefits over React Native.

With Hybrid, it's all a compromise, and it might be worth it. That's not my point. My point is: Don't use Ionic/web-based hybrid, if native input controls play an important part in your app. It might simply not be worth it, because there are better tools to achieve the same outcome.

Post reply on HN