|
|
|
|
|
by duncanawoods
3421 days ago
|
|
I don't mind if people prefer JSX its just a shocking cost - rewriting language ASTs, build tools and IDEs for something that rhymes with html but is really only a couple of characters away from standard language constructs. > I'm sure there's a law somewhere that says the less abstraction the better, that can be applied in this case JSX is literally an extra level of abstraction. You are not writing html but calling a function to create a data structure element and JSX totally obfuscates that. I pity poor programming newbies trying to understand what JSX is actually doing "so you are telling me <div> is a function...but?". In the functional form its just your normal language, nothing is disguised, everyone can see what it is doing and no post-processing magic is required e.g. public class DOM
{
public static IElement div(object attributes, params IElement[] children)
{
return new Element(...);
}
}
|
|
You would have to write the transpiler anyway, since on a larger team if you're working with a designer, you would probably get HTML from them and soon get tired of manually translating it to function calls.
I'd bet this is how JSX got started in the first place.