3 ms·
> Most features are not backward compatible Important thing is: The VM (or the interpreter, or whatever runs your code) is almost always backward compatible. I
by egeozcan 9y ago
> Most features are not backward compatible
Important thing is: The VM (or the interpreter, or whatever runs your code) is almost always backward compatible. If you write code now, it keeps on running. JS code from the pages coded a decade ago runs just fine. I can't say the same for (from the top of my head) Android, for example.
- realusername 9y agoAh yeah it's true, there's very few features that are actually removed from the browser. I just remember some kind of iframe version of window.alert (can't remember the name now) which got removed a few years ago but it wasn't used that much.
- baybal2 9y ago>JS code from the pages coded a decade ago runs just fine. Far from truth. A lot of breakage happen due to browser API security policy changes, obsolescence of browser APIs. In on case, I even saw a code failing because the behavior of mathematical operators with floats have changed over time. This is why there is little point for JS drafters being hellbent on backward compatibility to the absurdity (remember few pages long typeof null flamewar) >I didn't know about this. Do you have a source or explanation? (by the way, all numbers in JS are double-precision 64-bit format IEEE 754-2008 numbers so you mean they actually changed the operators?) As I understand, browsers' js engine, under some conditions, can provide more precision than what browsers were giving in nineties. That way if you vere reliant on if(1 - trickyFunction(0.000006464)) doSomething(), the condition will eval differently if function will return a value just a little bit bigger than 1.0000000000
- egeozcan 9y ago> In on case, I even saw a code failing because the behavior of mathematical operators with floats have changed over time I didn't know about this. Do you have a source or explanation? (by the way, all numbers in JS are double-precision 64-bit format IEEE 754-2008 numbers so you mean they actually changed the operators?) > A lot of breakage happen due to browser API security policy changes, obsolescence of browser APIs Non-standard features, yes. Standard features? Rarely (like WebSQL, opening HTML data URLs directly from code and so on). Standard features with wide adoption across browsers? I have just one case because of the recent CPU bugs. Standard features with wide community adoption? Never.