For example it looks like escape chars depend on language – HTML and Javascript for example do not have the same escape chars. Why not? It would be easier since sometimes it’s difficult to know whether you are dealing with HTML or Javascript and therefore it would simplify if escape sequences would be same for many languages.
Thank you for any comment or answer
It’s mostly a matter of using a character that isn’t needed for much in the rest of the language, combined with legacies arising from languages that had no idea they would eventually coexist. SGML, the predecessor of HTML, is older than Javascript. Javascript, in turn, wants to look like Java/C++/C, so it wants to use & to mean “and”. &tc…
When something new comes along, there’s a very high premium placed on it being similar to whatever’s already in use, to reduce the learning curve, thereby increasing adoption rate, thereby avoiding new-thing infant mortality. It’s also easier to implement a language that’s similar to one that already has implementations.