DEV Community

Discussion on: [Rant] Facebook API: avoid at all costs

Collapse
 
xowap profile image
Rémy 🤖

That's why I consider that anything made by Facebook is irrelevant. Except maybe Yarn.

Collapse
 
jason_espin profile image
Jason Espin

I'd hardly consider React irrelevant.

Collapse
 
xowap profile image
Rémy 🤖

Thanks for pointing it out, that was precisely the meaning of my message. To be fair, I have not used React extensively and so it's likely that I'm wrong on some points below yet I had much better time with other tools (Vue.js to be specific) and not found the need to explore React this much.

  • There is HTML in JS. This is very consistent with the coding style of the server-side of Facebook which is made in PHP apparently à-la-Wordess. I think that more of a decade of PHP frameworks made the point that this was a bad idea.
    • If anyone is thinking "Facebook is huge and works so it must be a good way to work" I'll refer you to the above article

  • There is no way to tie CSS to components like you can do in a .vue component
    • I'm just talking about putting the code in the same file, which is convenient for many reasons. I'm not talking about intermixing JS and CSS code which would be as bad as mixing JS and HTML (hope I'm not giving bad ideas to anyone here)

  • The learning curve is pretty steep and in fact the tooling required to master React is one of the big factors behind the "JS fatigue"

  • The way JSX does loops using JS functions... That looks smart but that is not legible (especially in the middle of HTML) which is a serious problem
Thread Thread
 
jason_espin profile image
Jason Espin

I've also used Vue.js and to be honest a lot of the points above are incorrect.

HTML is JS. I found this week's at first but if you understand the way that React works with the virtual DOM this actually makes a lot of sense.

One of the main features of React is that your CSS for a component is independent of other components just like Vue.

React is probably the easiest library to pickup. I say library because unlike Angular and Vue it does not control its own routing etc.

There are multiple ways to achieve looping. It is likely you have just seen one (sounds bad) variant.

Collapse
 
ben profile image
Ben Halpern

I feel like their OSS is different then their business platforms, though I'd love to hear more about your thoughts if you think otherwise.