Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is javascript backwards compatible to a fault?

In Coders at work, Douglas Crockford discusses how bugs in browsers cause Javascript to be a complex, clunky language and fixing it is a catch-22. In Beginning JavaScript with DOM scripting and Ajax Christian Heilmann says something similar "[The] large variety of user agents, of different technical finesse [...] is a great danger to JavaScript."

Why doesn't JS have a breaking new version? Is there something inherent n the language design where backwards compatibility becomes a must?

Update
Why can't javascript run with multiple engines in parallel? Similar to how .NET runs versions 2, 3 and 4 on the same machine.

like image 456
P.Brian.Mackey Avatar asked Feb 08 '11 19:02

P.Brian.Mackey


People also ask

Is JavaScript backward compatible?

In summary, the JS language is by definition backwards-compatible, which is due to its original web purpose. Backward compatibility can be problematic, but the emerging problems can be eliminate using solutions such as a transpiler or polyfill.

Why is backward compatibility necessary?

This is an important capability because backward compatible processors can execute the same binary software instructions as their predecessors, without needing new applications or operating systems.

What can be solved using backward compatibility?

Backward compatibility can be used to preserve older software that would have otherwise been lost when a manufacturer decides to stop supporting older hardware. Classic video games are a common example used when discussing the value of supporting older software.

How does backwards compatibility work?

Xbox One Backward Compatibility is free and allows you to play select Xbox 360 and Original Xbox games you already own on Xbox One. Xbox Series X|S Backward Compatibility is free and allows you to play select Xbox 360, Original Xbox games, and Xbox One games you already own on Xbox Series X|S.


2 Answers

Lazy copypasta at OP's request:

JavaScript is just a programming language: syntax and semantics. It has no built-in support for browsers (read: the browser DOM). You could create a JS program that runs outside of a browser. You (should) know what an API is - the DOM is just a JavaScript API for manipulating an HTML page. There are other DOM APIs in other languages (C#, Java, etc.), though they are used more for things like XML. Does that make sense?

Perhaps this MDC article can clarify further.

like image 65
Matt Ball Avatar answered Sep 23 '22 02:09

Matt Ball


Well a breaking change would break a lot of existing websites, which would make a lot of people very angry :)

like image 25
Adam Rackis Avatar answered Sep 25 '22 02:09

Adam Rackis