Live data from Hacker News

Why I moved from Angular to React

robinwieruch.de

81–90 of 107 posts

Re: Why I moved from Angular to React

#82
I think some people just don't get React. The beautiful thing about it is that it's really simple. Yes you create components but it's not just about components. The idea that you can treat your app ass a function and just feed it one global state is what makes it so powerfull imo. That being said there are a lot of paradoxes with react. For example it was created with functional ideas in mind and the functional comunity loves it, but at the same time i have the impression that the facebook deeloppers building it just didn't got it for a long time, and its still sinking in. Just looking at how there are classes for everything and all. It looked mor OO at the begining. And the whole flux, one would think they dont't understand the power of simplicity completly. Then there is the problem of finding the correct patterns to work with it. A lot of times you have OO people that start writing js software and when you look at the code they produce you feel like crying. Then they blame react because they just don't know how to think different.

Re: Why I moved from Angular to React

#83
post #37
post #27

React comes with its own syntax to build components called JSX. In JSX you can mix up HTML and JavaScript. Additionally people often use inline styles in their elements. It is like adding CSS into the mix. This really scares me. We spent a lot of effort removing inline styling from HTML with CSS, and yet it still creeps into our HTML. We also have created a lot of "template" languages (e.g. PHP, Python, ERB, etc.) mi…

As mentionned already, and as Pete Hunt famously talked about in "Rethinking Best Practices" (you can find it on youtube), you want to separate -concerns-, not technologies. Often there is a 1:1 between those things, but not in modern web development. So we've seen a push toward components that mix technologies, but separate concerns. And it's been great.

This is just rhetoric. The notion of separation between information, presentation and behavior couldn't be any more fundamental. But instead of developing this idea any further most web developers had traditionally settled for something "easy" and complicated (i.e. JQuery that dictates all of the three things I mentioned).

In the long run, the SPA craze will backfire, big time. Rect components are not semantic and not declarative. There is no way to examine them without executing code. This is an elephant in the room most fronted developers willfully ignore right now.

Re: Why I moved from Angular to React

#84
post #27

React comes with its own syntax to build components called JSX. In JSX you can mix up HTML and JavaScript. Additionally people often use inline styles in their elements. It is like adding CSS into the mix. This really scares me. We spent a lot of effort removing inline styling from HTML with CSS, and yet it still creeps into our HTML. We also have created a lot of "template" languages (e.g. PHP, Python, ERB, etc.) mi…

I'm not so worried about it. The CSS is self contained these days in "components" where it doesn't leak out everywhere, which was the overarching problem with CSS from the beginning. Looking at UI platforms historically it's pretty standard for UI components to style themselves, it just wasn't realistic to do on the web until webcomponents started becoming reality.

Styling is syntactically really just markup decorators after all, although CSS may end up Turing complete if it isn't already :) (this is probably a bad thing)

Re: Why I moved from Angular to React

#85
post #83
post #37

Earlier quoted context omitted.

As mentionned already, and as Pete Hunt famously talked about in "Rethinking Best Practices" (you can find it on youtube), you want to separate -concerns-, not technologies. Often there is a 1:1 between those things, but not in modern web development. So we've seen a push toward components that mix technologies, but separate concerns. And it's been great.

This is just rhetoric. The notion of separation between information, presentation and behavior couldn't be any more fundamental. But instead of developing this idea any further most web developers had traditionally settled for something "easy" and complicated (i.e. JQuery that dictates all of the three things I mentioned). In the long run, the SPA craze will backfire, big time. Rect components are not semantic and no…

I like the typo: react => rect and the inevitable rekt

Re: Why I moved from Angular to React

#86
I have experience building a mobile app using Ionic framework. Ionic uses Angular for its view library. In my opinion, one thing that I dislike about Angular is documentation. I think Angular has lack of documentation. It has short explanation and no examples/use case for that function. I don't know if the documentation has changed since then because I built that app in 2015.

Now, when reading Hacker News, a lot of people post about React. I have never learnt before. Maybe, I am late to the party. I must dig posts about React to know its use cases.

Re: Why I moved from Angular to React

#88

All these discussions miss the point to me: React can be run natively on Android and iOS. Can Angular? Vue? Elm? It seems like there can't be any real competition when starting a large class of new projects until the answer is "yes." So I'm asking: what are the best real alternatives that work natively on mobile?

How is React running natively in React Native? The most basic things are reimplemented (quite badly) in JS, such as controller navigation (for the lack of a better term), buttons, gestures, animations. Most of them run on the JS stack, which is run on a JavaScriptCore VM instance, the same VM running when using a web view. How is any of that native? For me, "native" means using only OS-native components for navigatio…

The choice of words was poor, but the point of the original poster, I think, were clear.

React-native provides react with primitives that are native (such as View, Button etc...).

Navigation is also native (as in the transitions are native).

Until angular or vue can run withou the dom (which is the #1 reason for performance issues in wwb apps), they cannot compete with react.

Re: Why I moved from Angular to React

#89

I've used ExtJS, Backbone, CanJS, Angular, Polymer and React commercially. To me, React is a more complex alternative to Google's Polymer framework. In React, a component is made up of code which has HTML inside it. In Polymer, a component is made up of HTML which has code inside it. They're actually the inverse of each other but the result is almost exactly the same - Both libraries allow you to build components whi…

> You can do cool stuff like allow a sub-component's style to change automatically as you move it from one parent component to another.

I don't like this at all. I want all the styles to be encapsulated to the component only. It shouldn't matter what parent component it's in. Polymer's CSS automatically spills over into the child components.

Re: Why I moved from Angular to React

#90
post #27

React comes with its own syntax to build components called JSX. In JSX you can mix up HTML and JavaScript. Additionally people often use inline styles in their elements. It is like adding CSS into the mix. This really scares me. We spent a lot of effort removing inline styling from HTML with CSS, and yet it still creeps into our HTML. We also have created a lot of "template" languages (e.g. PHP, Python, ERB, etc.) mi…

There never was any separation of concern. Just because the HTML, JS and CSS were in different files don't mean they were truly separated. React embraces this fact and it's extremely refreshing. Each component's HTML, JS and CSS belong together.

> logic buried in HTML that is hard to find and hard to reason about

That's a complete non-issue with React and much more an issue of the traditional way of breaking it up in different files which look separated but in reality are extremely entangled.

Post reply on HN