Live data from Hacker News

Ask HN: Is there a sane alternative to Angular and React?

news.ycombinator.com

61–70 of 85 posts

Re: Ask HN: Is there a sane alternative to Angular and React?

#61
post #26

Vue.js is saner because it does not have that JSX nonsense and you can still write most of the code however you like, and later upgrade to babel,typescript etc. Particularly I like component structure https://vuejs.org/v2/guide/single-file-components.html which kinda does the same in more traditional approach.

Came here to mention this one. Vue is nice and clear in all the ways React and Angular (both flavors) are not.

It's just simple and enforces "good" practices by making sense of them.

Re: Ask HN: Is there a sane alternative to Angular and React?

#63
I'll semi-answer your question by giving you my standard set of advice and resources for learning React.

The article "A Study Plan to Cure Javascript Fatigue" ( https://medium.freecodecamp.com/a-study-plan-to-cure-javascr... ) is a great place to start. It gives an excellent series of steps for tackling modern Javascript concepts one piece at a time: Javascript, React, ES6, and state management.

On that note, definitely don't over-complicate the learning process by trying to learn many different things at once. Some people will say you should use a "boilerplate" to learn React, and they're wrong - boilerplate projects almost always come with too many pieces configured, and are confusing for beginners.

Instead, the best advice is to focus on learning React itself first. Once you have a good understanding of how React works, you will better appreciate why a state management library like Redux can be useful, and you can learn about other tools later.

You should start out by reading through the official React docs and tutorial at https://facebook.github.io/react/, and I'd encourage you to use the official Create-React-App tool ( https://github.com/facebookincubator/create-react-app ) for setting up projects. It creates a project with a solid build setup, with no configuration needed on your part. There's an excellent post called "Simple React Development in 2017" ( https://hackernoon.com/simple-react-development-in-2017-113b... ) that gives some more specific instructions on the actual steps to follow.

Past that, I keep a big list of links to high-quality tutorials and articles on React, Redux, and related topics, at https://github.com/markerikson/react-redux-links . Specifically intended to be a great starting point for anyone trying to learn the ecosystem, as well as a solid source of good info on more advanced topics. It includes links for learning core Javascript (ES5), modern Javascript (ES6+), React, and much more. I also published an "Intro to React (and Redux)" presentation at http://blog.isquaredsoftware.com/2017/02/presentation-react-... , which is a good overview of the basic concepts for both React and Redux.

Finally, the Reactiflux chat channels on Discord are a great place to hang out, ask questions, and learn. The invite link is at https://www.reactiflux.com .

Re: Ask HN: Is there a sane alternative to Angular and React?

#64
React does not require JSX; it is just a sugar over React.createElement. By way of example:

Hello World

React.createElement('h1', { className: 'title' }, 'Hello World');

A very contrived example but it's pretty simple to see that if you're coming from a background where you previously used a lot of "JavaScript in HTML" and aren't used to "Markup in JavaScript" it makes for a good middle ground. As well, as you can likely infer from the example, when you start dealing with various nested children the pure JavaScript solution can get somewhat unwieldy; though that comes down to taste, mostly.

While I empathize with your position (I'm not a big fan of the transpilation trend) I do find React to be much more sane than Angular 1.x was and much more relevant to what I build than jQuery.

Re: Ask HN: Is there a sane alternative to Angular and React?

#65
post #60
post #17

Server-side rendering with partial views? You're never going to get something as simple as Flash, with a write-once works everywhere. But your user's aren't going to be annoyed at the crappy UX that Flash (or Flex) applications brought us. EDIT: I'm dead serious about this, with the concept of isomorphic apps, I'm not convinced building thick Javascript-based clients is necessarily the way to go for a lot of use case…

The application I've inherited and support is a Rails app that does this. I hate this pattern. It's very difficult to change things and burdens the backend developer with the responsibility.

I'm pretty new to Rails, but I'm implementing something very similar to this. Is there's any open source mature Rails app that might demonstrate what your seeing/maintaining? I'd be curious to see how this pattern looks as it grows.

Re: Ask HN: Is there a sane alternative to Angular and React?

#66
post #36

Earlier quoted context omitted.

The main reason I didn't consider Vue was because I like coupling HTML and JS like React does. But this seems like a much nicer way of doing it than JSX. I'll have to give Vue another chance.

> But this seems like a much nicer way of doing it than JSX. Note that there is no requirement to use JSX, JSX is just syntactic sugar for the underlying function calls which you can use directly: https://facebook.github.io/react/docs/react-without-jsx.html That's useful when you don't want to add a local compilation file when developing/debugging.

This argument doesn't make sense because doing it like that is even worse that JSX.

Re: Ask HN: Is there a sane alternative to Angular and React?

#67
As someone else said the platform itself is not sane.

However on the scale of things that we have, React is pretty sane.

I have never seen someone who spent significant time with React and thought it wasn't sane.

There are some people who are stuck with some 2005 MVC jQuery PHP AJAX mindset repeating worn-out lines like "don't mix logic with views". All their alarms go off when they see JSX.

I don't for a moment think any of this crap that we have is "elegant".

I hate TypeScript/Javascript/React/Redux/Webpack/JSX/Yarn/NPM/Node etc... and I also love them and use them.

Those things that I listed in 2017 enable a class of web applications to be created that is simply not practical to build with send-html-from-the-server-and-sprinkle-jquery-event-handlers-on-the-client technologies.

At this point it's Javascript vs everything else.

I used to build applications with PHP/Laravel/Django/Flask/Sinatra etc... now I don't consider them anymore for web applications (still ok for content sites, not complex applications).

The smooth robust magical UI/UX that I can achieve with TypeScript/React is miles ahead of all other options, it's still full of crap, but still miles ahead of other options.

Again I re-iterate my main point, which is things have now changed in such a way that the competition has become Javascript/TypeScript vs everyone else.

If you are going to build HTML in a string on the server and sprinkle some javascript on top it doesn't make that much difference whether you use PHP or Python.

Re: Ask HN: Is there a sane alternative to Angular and React?

#69

Since I discovered Clojurescript using reagent, re-frame and figwheel it is hard to go back to any JS framework, or JS itself. The feedback cycle is so short that it feels like doing Smalltalk properly. Now I wish I could use similar combo for mobile and desktop development.

> Now I wish I could use similar combo for mobile and desktop development.

Check out "re-natal". That at least gets you mobile, and perhaps desktop once react native has a good desktop story.

Re: Ask HN: Is there a sane alternative to Angular and React?

#70

ASP.NET MVC for the back end is beautiful, clean, simple, and then you can use a bit of jQuery on the front or use Knockout JS if you want to do data-binding with MVVM and not have to learn with or deal with all the other crap of those frameworks mentioned as that is what MVC already does for you. Don't reinvent a browser in the browser or waste more time on JS than you need to, you'll feel so clean separating things…

I think this could be simplified a little, and still remain true:

> 'Boring' language OOP/MVC for the back end is beautiful, clean, simple, and then you can use a bit of jQuery on the front

This bit should be considered golden advice IMO:

> Don't reinvent a browser in the browser or waste more time on JS than you need to,

Post reply on HN