News for hackers. Stuff that matters.
Re:JSX is no longer my friend by Mizza on Tuesday March 15, 2016 @04:24PM (#11292687)
Finally, somebody said it. I thought we abandoned that garbage when we left PHP, and now all of a sudden everybody wants to start mixing markup and code again?
Re:JSX is no longer my friend by daveidol on Tuesday March 15, 2016 @04:30PM (#11292727)
Hyperscript is the same thing as JSX when used with React; just a different syntax. Either way you are "mixing markup and code."
Re:JSX is no longer my friend by matt4077 on Tuesday March 15, 2016 @09:07PM (#11294266)
There's no escaping the fact that when you have an array of objects, you're going to loop over them to generate html. At that points, it's idiotic to learn some contrived new templating language when you already have .map.

Seriously: Separation of Concerns is solved. Yes, you were once far ahead of the pack. But at some point _everybody got it_. It no longer needs a (cumbersome) technical solution because we solved it with education, and developers have been highly disciplines since almost the late 90ies.

Re:JSX is no longer my friend by qaz_plm on Tuesday March 15, 2016 @04:40PM (#11292808)
So there's hope for using tables again as layouts in HTML?!
Re:JSX is no longer my friend by wvenable on Tuesday March 15, 2016 @05:55PM (#11293318)
We abandoned mixing view logic with program logic. It's perfectly reasonable to use PHP as your template engine as long you don't mix your program logic into your templates.

React is a view engine; everything done in react is to construct and maintain the view.

Re:JSX is no longer my friend by spriggan3 on Tuesday March 15, 2016 @07:45PM (#11293914)
The difference is JSX XML syntax is not a templating language but a functional one. In that sense it has nothing to do with PHP templates or any JS templating system based on string templating. it's XML directly in Javascript.
Re:JSX is no longer my friend by jhall1468 on Tuesday March 15, 2016 @04:51PM (#11292878)
1) Like it or not PHP is still one of the top 5-10 languages used today.

2) The separation of concerns argument is completely invalid. They aren't separate concerns, they are separate languages.

Re:JSX is no longer my friend by M4v3R on Tuesday March 15, 2016 @04:53PM (#11292895)
Exactly this. Can someone explain to me what do people see in JSX way of creating components? What happened to good ol' code vs template separation and what's now wrong with having two separate files - .html (or jade, or whatever) and .js?
Re:JSX is no longer my friend by bicknergseng on Tuesday March 15, 2016 @05:11PM (#11293036)
What does code/template separation actually achieve? Ignoring JSX for a moment, why are templates a good thing? Are you actually simplifying something by using {{#each}} instead of .map()? Is {{#if}} really better than if()? Seems to me like templates don't actually decouple code.
Re:JSX is no longer my friend by bigpeopleareold on Wednesday March 16, 2016 @06:58AM (#11296339)
In a large application, it starts to become a pain to deal with. It doesn't obviate the need to be careful over mixing responsibilities. In general, React components should just be things that render out to the DOM. If the HTML code is in JS, it doesn't matter as much as the more important thing of separating out your application layers.