Hacker News new | past | comments | ask | show | jobs | submit login

It seems like no one asks "Just because we can use Javascript for everything, should we?"

Pros: AJAX for loading content makes requests smaller making your app more performant.

Cons: The Javascript framework requires a 1xx KB download before content can be rendered, making your app less performant, hurting SEO, and breaking the back button (no, I don't want to scroll again from the top through the 5 posts I already read when I come back to your site).

You hate maintaining an entire application in Javascript so you get to learn all the joy of transpilers and a build system to build whatever not Javascript language you chose and your tens of module dependencies because you decided everything had to be done in Javascript or TypeScript or ES2015 or CoffeeScript or ES7. Oh and when a new language supersedes the language you decided to use, you happily spend weeks moving your codebase to a new language, thinking "Wow static typing in 2015?! My code is so much more maintainable now!"

It says it all that the benchmark for comparing frameworks is TodoMVC, a simple CRUD application for which client side rendering is unnecessary. People are not thinking at all about the pros and cons of client-side rendering and reaching for it for any web applications.

Google doesn't use AngularJS for Gmail. They use GWT to render HTML on the server. Side note: AngularJS 2 beta is 500KB. Fucking laughable. Oh and they suggest loading both the AngularJS 1 and AngularJS 2 frameworks on your page to help you migrate.

Facebook doesn't use ReactJS for Facebook. They use PHP to render HTML on the server. Edit: Yes Facebook uses ReactJS for a lot of side stuff, but not for big items like their newsfeed.

Twitter doesn't use client side rendering. They tried it but reverted, because the time to first see the content was too long.

People are building a mountain of abstractions and investing so much time to over-engineer everything in Javascript. WHY?!




> Facebook doesn't use ReactJS for Facebook. They use PHP to render HTML on the server.

This is false. Facebook is a huge user of React—it's one of their "pros" over Angular (which Google doesn't use as much).

The entire Instragram site is built with React, and all new development is with it[1], as well as parts of their existing UIs[2]. They are gradually replacing everything with it because redoing the whole site at once is impossible to do. They are also putting a ton of work into React Native and use it in some of their products [3].

Facebook seems to put some of their smartest engineers in the React and React Native teams as well as related projects like Immutable.js, and grab talent as quickly as they can (like Dan Abramov). It's silly to think that they're spending so much money on it for nothing.

[1] https://www.quora.com/Who-is-using-Facebook-React

[2] https://groups.google.com/forum/#!topic/reactjs/5K4fXu1aCTs

[3] https://facebook.github.io/react-native/showcase.html


I didn't mean to imply Facebook doesn't use ReactJS at all. The point was they use it on a need by need basis, not all in SPA all the time.


Ah I see. Sorry for misreading. Still better than Angular's situation though, and I'd argue React Native is more important/more likely to be fully used at Facebook.


> The Javascript framework requires a 1xx KB download before content can be rendered, making your app less performant, hurting SEO...

False. React can be rendered on the server and sent in the initial request using ReactDOM.renderToString.

> You hate maintaining an entire application in Javascript...

No I don't. I'd rather write an entire application in JS than write an application (backend and frontend) in two different languages, or write a frontend as a series of ad-hock JS scripts. If I hated maintaining an entire app in JS, why would I maintain it using JS? I use JS for everything because I prefer it to the alternatives.

> a simple CRUD application for which client side rendering is unnecessary.

No one needs to do an SPA. The world got by just fine without it. For me, the reasons to do an SPA with ES2015 modules had to do with simplifying my frontend architecture. JQuery is easier to get wrong compared to the render-everything mindset of React.

> Google doesn't use AngularJS for Gmail.

Good for them. Angular sucks IMHO. That being said, Gmail came long before Angular, and why migrate when you have a working product?

> Facebook doesn't use ReactJS for Facebook.

Facebook doesn't use ReactJS for --everything-- on Facebook. The fact that React can be gradually migrated into an existing application is one of React's greatest strengths.

Facebook do, however, use React for Instagram. They even use webpack for this.

> Twitter doesn't use client side rendering.

Define client side rendering. When I scroll down on the page and new items magically appear, I would say that is client side rendered. The time to first see the content, using React, could be done by first rendering React on the backend. But why migrate when you got a working product?

> People are building a mountain of abstractions and investing so much time to over-engineer everything in Javascript. WHY?!

Is it over-engineering when it solves a problem and does nothing more than it has to? React renders views, that's it. You can render on the frontend, backend or both. React is easier to use than having many different JQuery-based scripts.

In short. React does one thing. It does it well, and it simplifies my UI code. How is this over-engineering? I could say the same for gulp (for me, easier than bash scripts), webpack (easier than makefiles), ( node+express (waaaaay easier than Java or C#), Immutable.js (makes things easier to reason about) and the rest of my pure JS-stack.


"Google doesn't use AngularJS for Gmail" - IMHO This is non-reason for a start. Why will they suddenly start migrating their main product which was built a long time before Angular was developed. Meanwhile most of the new websites at Google are being developed using Angular - google trends, google fiber, DoubleClick etc.


> Facebook doesn't use ReactJS for Facebook. They use PHP to render HTML on the server.

Being able to render your javascript server side with isomorphic (or universal) javascript is one of React's big selling points.


ReactJS is used for the Facebook's people search page (mobile web version). Most Facebook web pages are renderer on server with PHP/HACK.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: