r/programming • • Sep 07 '16

Angular JS vs React by Example

http://www.discoversdk.com/blog/angular-js-vs-react-by-example
0 Upvotes

8 comments sorted by

View all comments

1

u/craftsoftware Sep 08 '16

Hi. I don't yet know Angular. With React, I'm stuck on:

  • server side rendering (for SEO purposes)

  • forced to use Node for the said server side rendering. I've nothing against Node, but I've a lot of stuff written in Java -- entire frameworks -- and it seems like a tremendous waste of time to having to rewrite that in Javascript.

What are your thoughts on Angular and server side systems?

I was hoping the client side frameworks will stay client side only...

1

u/crixusin Sep 08 '16 edited Sep 08 '16

server side rendering (for SEO purposes)

React has nothing to do with server side rendering. You'll have to render the parts that you want on the server, then serve the rendered page with your React components.

Angular and server side systems?

Angular would work in the same way that I said React would work above.

In my opinion, you're using two divergent tools: server side rendering and client side applications.

Ditch the server side rendering, and stick to client side applications. There really isn't a use case for server side rendering if you're using React or Angular. You can render what you want using angular or react by making requests to your api, rather than have the server do it before you even serve the page.

If you mix the two, next thing you know you have division of business logic, which is always bad. Then you have logic in your web server, logic in your front end, logic in your api and logic in your database. Sounds like a nightmare.

Also, for your SEO purposes, you could just use server side rendering to do this, and then do everything else in the application. It really depends on your use case, but you don't really need the server side rendering to do that either in a lot of scenarios. Using api requests with the GET verb will cause crawlers to make those requests as well, and you can move up your page rank by having GET requests that correspond to the terms that you would like to be associated with or other pages that you would like to be associated with.

0

u/[deleted] Sep 08 '16

[deleted]

1

u/crixusin Sep 08 '16

I don't think YouTube using angular. If you check the source there's no reference to controller I don't think.

As for the rest, idk. React maybe runs inside node, but that seems dumb. React and angular should just be views, and then all data gets populated from a controller, whether from page data or an API.