4 ms·
JSX always seemed like a red flag to me. It was redesigning something that already exists to make it so that it uses non native browser functionality? Also the
by nickthemagicman 6y ago
JSX always seemed like a red flag to me. It was redesigning something that already exists to make it so that it uses non native browser functionality? Also the portability looked like an issue from it.
I don't understand the use case for it. Vue and apparently Angular use basic browser friendly components.
- bluefirebrand 6y agoWhy does it really matter if the code you write is browser friendly or not? Everything is transpiled to browser code anyways, that includes Vue and Angular and JSX. None of the code you write is ever really touched by a browser anymore. At the very least it's minified.
- nickthemagicman 6y agoAgree completely! I think the whole ecosystem is insane! Something that needs 3 or more layers of transpilation...is not right. Typescript to Babylon to JS. Sass to css. These are workarounds for native JS warts. That's why Im excited about NATIVE web components and future releases of JavaScript becoming sophisticated enough that we can ignore all of this framework insanity. Or even better...web assembly somehow taking over and making all of this pointless. Native Typescript. Yes please. But to address your point, you're locked into JSX a lot more than someone writing in native browser code that doesn't need transpilation and can be ported between other frameworks at the end of the day.
- bluefirebrand 6y ago> But to address your point, you're locked into JSX a lot more than someone writing in native browser code that doesn't need transpilation and can be ported between other frameworks at the end of the day Not really, because at the end of the day you still have to write the HTML and CSS and everything to render anything in a browser, the JSX really just gives you a new way to compose it. Now if you're using other styling frameworks that provide their own components, you might not have access to that HTML but that's not a JSX problem that's a "you are too reliant on outside dependency" problem. Also, transforming code into a runnable form has been a part of programming since we first invented compiled languages. Your comments about transpilation seem really bizarre with that in mind.
- nickthemagicman 6y agoTransforming code. Compiling has. Transpiling is much less common and seems to me to be an anti pattern or a sign that something's not correct in what you're building on top of.
- erlich 6y agoI think in 10 years we are going to see a lot of stuff built into the web platform. Typescript definitely now that MS is using Chromium. Then we have Deno for the backend. One day in the future a kid will be learning programming, and not realize the billions of lines of tooling, or the hundreds of thousands of hours of thought that was put into working around an inadequate platform. However, a lot of this will have been necessary to get to the end result. But also a lot will not have.
- nawgz 6y agoHow is magically hydrating a DSL extension of HTML any better than using JSX? Arguing about "non-native browser functionality" doesn't make any sense to me, your Angular app doesn't work until it's com-trans-piled into the same HTML/CSS/JS output that JSX produces...
- nickthemagicman 6y agoOh I agree. It's all insane. Ready for native web components and/or web assembly to become mature and get rid of this JS framework, 5 layers of transpilation, nonsense. But to address your point, you're locked into JSX a lot more than someone writing in native browser code that doesn't need transpilation and can be ported between other frameworks at the end of the day.
- nawgz 6y agoI really can't understand what your objective is here. Frameworks are going to exist in every single language. Do Python developers say "I cant wait til Pandas isn't part of my workflow"? I also will challenge your sentiment that JSX locks you more into a framework than writing DSL extensions of HTML. JSX is supported by quite a lot of frameworks, so you aren't locked into React; additionally, React is the best UI library; additionally, JSX is pretty semantically clear with what HTML elements your functions are binding to and what events they're paired to, so in either case you have to rewrite code for your new DSL. Going between Vue and Angular isn't going to be simple.
- nickthemagicman 6y ago"JSX is supported by quite a lot of frameworks, so you aren't locked into React" Just not the browser natively.... Most backend frameworks don't need numerous layers of transpilation because they're on an actual OS and arent trying to work around an insane environment like the browser that's full of warts and incompatibilities. What's the churn on Pandas? It's been around over a decade. And it can probably be reliably counted on to be around a decade more. It will be surprising if React is around in 5 more years and hasn't been replaced by something else. Is EmberJS still around? How much longer will webpack be around? Stability in the browser ecosystem starts with stability in the browser. I think instead of investing all this energy into browser frameworks we need to be devoting energy into making the browser do what we want it to do natively. And as web assembly matures that's where I think this is headed.
- erlich 6y agoI hated JSX when it first came out and thought React wouldn't take off because of it, then I used React for 5 years, and I still hate JSX. I write all my components like this: const props = {foo: 1, bar: 1} <MyComponent {...props}> {children()} </MyComponent> function children() { return foos.map(b => <div>{b}</div>) } Why do I have to use a weird language with non-standard JS stuff. Writing conditionals in JSX is horrible, and props are unnecessarily verbose when we have ES6 language features like structuring. It could easily be just a nested tree structure.
- mmis1000 6y agoFull flexibility means full responsibility. If I write sh_t, it will be sh_t and no one can stop me.(well, you have the full power of a turning complete language). Unfortunately not every team can afford it without trashing their code base eventually. (And yea, I don't even have the confidence that I won't. And even I do, what about teammates?). I always thinks having too much flexibility here is sometimes cons instead of pros.
- nickthemagicman 6y agoEntropy applies to all things not just front end software. A very strict and structured dev environment seems to always lead to better software.