Remember ECMAScript for XML (E4X)? Deprecated in 2014.
en.wikipedia.org/wiki/ECMAScri

var sales = <sales vendor="John">
<item type="peas" price="4" quantity="6"/>
<item type="carrot" price="3" quantity="10"/>
<item type="chips" price="5" quantity="3"/>
</sales>;

alert( sales.item.(@​type == "carrot").@​quantity );
alert( sales.@​vendor );
for each( var price in sales..@​price ) {
alert( price );
}

Follow

@rauschma I guess it's spelt “JSX” nowadays.

@tripu @rauschma

Yeah! One wonders if E4X had stayed, would we be able to use it instead of all the different JSX-transform add-ons? Wouldn't that actually be nicer?

@duncanmak @rauschma That's what I think, too: that a well designed standard would have worked better than React-centric and idiosyncratic JSX…

@duncanmak @tripu @rauschma the problem was E4X was in Flash - it didn't run in browsers (and certainly not IE6, which was utterly dominant at the time). We only used it for data, and JSON was so much easier (and smaller) to deal with. We stopped using Flash entirely in about 2009.
Meanwhile, JSX compiles to a list of function calls rather than templates, so even if you data drive it (which I have seen done but rapidly become very hard to maintain) JSON is easier than XML.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.