Hacker News new | ask | show | jobs
by n3pg 1375 days ago
Seperation of languages != seperation of concerns

One could argue the adoption of JSX actually allows for better seperation and cleaner code as you can group all the necessary pieces of your component together, and use components declaratively without introducing some DSL seen in some frameworks like Vue, Angular etc.

1 comments

Isn't className custom DSL in React?

Vue's concepts in the v-* are more pleasant than the React way, imho. Learning a bit of DAL is not a blocker for me, given how many tools already require this

I'd rather just use JS syntax than learn a random v-* syntax.

You can just use the std lib to loop, filter, reduce, conditionally render, etc. rather than looking up how to loop in this specific framework with v-if, v-for, etc.

Angular 1 did that and it was limiting. Two-way data binding also failed.

Templates are dead, long live JSX.

Vue doesn’t do two way data binding.

Are you more likely to use it knowing that?

The data binding was a comment for React and against Angular and similar frameworks. The template syntax was a comment against Vue.

And no I'm not interested in Vue due to many reasons. I can expand if you're interested.

But why would you switch to copy cat frameworks when you have React and React Native?

My main point was for JS DSL and against proprietary template syntax, what are your thoughts on that specifically?

I don’t particularly care one way or the other. I like Vue because it offers flexibility and some opinions. If I want to write a jsx render function, I can do that. If I have a simple functional component for an icon or whatever, I can use the DSL and it’s statically compiled for the final build.

I don’t agree with your point about copy cat frameworks generally, as we’ve reached the point where all the major players are adapting each other’s ideas constantly. I think any of the modern JS frameworks are more than capable of handling any use case.

No, `className` is the DOM property exposed to JavaScript that corresponds to the `class` attribute in HTML: https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...
React JSX mostly uses JS DOM property naming (className, style, tabIndex) but converts a few HTML-style attributes (data-, aria-)