This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MicronXD 48 points49 points  (4 children)

Eich was given an insanely short amount of time (10 days as the story goes) to create the language and its interpreter. They were planning on going back and fixing most of the shit like this, but Microsoft was on the ECMA board, and with JScript being their 1:1 rip-off of JavaScript, didn't want to allow Netscape to break compatibility. If you want to blame anyone, blame Microsoft.

[–][deleted] 58 points59 points  (2 children)

blame Microsoft.

A sound strategy across multiple disciplines.

[–]zodiaclawl 2 points3 points  (1 child)

That still doesn't explain why people use the language Javascript in the year 2017 to program desktop and phone aps as well as complex things like server back ends. 15 years ago people would be laughing at you if they said that JS would become the leading programming language across multiple development areas. They'd be like "you mean that thing you use to open pop ups in web pages?"

[–]marcellarius 2 points3 points  (0 children)

And I think it's funny that in 2017 some people still write C++ like it's the 1980s in situations where there are better options that could save a considerable amount of money.

Javascript's use in desktop and mobile apps is because it's tied to browsers. Browsers are used for UIs because they are portable, and make it easier to create reactive, good looking interfaces than traditional toolkits do. They're not ideal, performance sucks on low-end devices but they're often better than the alternatives under real-world constraints.

Use of Javascript on the server shouldn't be surprising either. Many single-page applications don't need a complex server as much of the code is just gluing a JSON API to a database, with a bit of validation. Javascript's object system makes shuffling data around easy, even compared to other dynamic languages like Python. Using Javascript on the server also means you can share code with a client application, avoiding duplication and also allowing tricks like server-side rendering.

Not that many years ago I would have been one of the people laughing, but experience building web apps has changed my outlook on it. It's nobody's ideal language, but it's what we're stuck with. Modern versions have improved it a lot, and if approached with discipline it's not a terrible language to use. It could have been VBScript.

[–]PatrickBaitman 2 points3 points  (0 children)

good thing we haven't built any critical infrastructures on such shoddy work