3 ms·
Javascript didn't get popular because of "its power," it got popular because it was the only option* and because of inertia (all legacy scripts on the web were/
by smitherfield 11y ago
Javascript didn't get popular because of "its power," it got popular because it was the only option* and because of inertia (all legacy scripts on the web were/are in Javascript, because it was/is the only option).
Edit: * Yes, I'm aware of VBScript, Flash, Java applets and ActiveX, and I'm aware they were all worse than JavaScript. Doesn't then follow that JS is good, or that it won on a level playing field. Frankly, it says something that for all its many faults Flash was often the superior option until the late 2000s.
- raverbashing 11y ago> Doesn't then follow that JS is good Of course not, and, sure, Flash was a better alternative for a lot of time (but mostly for things outside of JS like HTML5 capabilities) C is not great as well, but between something good that doesn't do what is needed and a bad one that does guess what is used in the end.
- smitherfield 11y agoI knew C; C was a friend of mine. Javascript, you're no C! When it appeared, C was a revolution in programming languages. It offered a combination of performance and expressiveness that simply outclassed anything else available (still true today, 43 years later, if more narrowly). It instantly became the most popular and held that position to this day, becoming a major influence on virtually every other popular programming language that's come since. Now, of course, C is much better suited for, say, writing an operating system than it is for writing security-intensive internet services. (A concept which did not exist in 1972). But, all things considered, it was as close to perfection as a new programming language has ever come at the time of its introduction. JavaScript is not even in the same realm; much superior, existing scripting languages (Python, Ruby, even Perl or some Lisp dialects) were passed over in favor of a deliberately half-assed effort to advertise Java with a language that shared a name and a superficially similar syntax, which (almost accidentally) became the only VM that any web browsers implement.
- raverbashing 11y ago> much superior, existing scripting languages (Python, Ruby, even Perl or some Lisp dialects) were passed over Python existed in 1995, but I doubt it was very known at the time. Ruby was created in 1995 Lisp is older, sure, but maybe there were concerns about the syntax and interpreter requirements? "But, all things considered, it was as close to perfection" Pascal didn't have a braindead way of dealing with strings. C's syntax is weird and prone to bugs, "if (a = 1)" being one example.
- smitherfield 11y agoYes, C's string handling is pretty crappy (especially given how important a data type strings are in Unix). And its operator precedence rules aren't always the best. But just like 10 million Elvis fans can't be wrong, neither can a language that is to programming what Elvis, the Beatles, and Michael Jackson put together were to music be anything other than a triumph of engineering. Better string handling or not, just as surely as video killed the radio star at about the same time, C killed the Pascal programmer. And the FORTRAN programmer, and COBOL, and BASIC, and assembler, and pre-1972 Lisp, and all the other old programming languages that are nowadays too obscure for me even to list. And operator precedence or not, every non-Lisp programming language of any popularity today apes C's syntax, not Ada or BASIC or somesuch. I'm not saying C is perfect. I don't even particularly like coding in C; I'm just saying that it just was a huge breakthrough in programming language design at the time it came out, and was overall the best designed language ever to that point (which, Lisp fanatics and Donald Knuth aside, I think most would agree with). Certainly not something you could ever say about JavaScript with a straight face. My point re scripting languages was that if Netscape had wanted to be on the bleeding edge, they still had much better choices. JavaScript is a programming language created in one week, where one of the major design considerations was to be an advertisement for a different programming language, and it shows. It certainly showed in 1995, before we had 20 years, billions of dollars and millions of man-hours invested by all the major companies in optimizing VMs, improving the standard, creating libraries and all the other miscellaneous forms of putting lipstick on a pig.
- aaronem 11y ago