JavaScript Turns 25 (zdnet.com) 50
The programming language JavaScript emerged 25 years ago and has grown to become one of the most important pieces of the web and browser applications we use today. From a report: JavaScript is the go-to language for front-end development and has spawned Microsoft's Typescript, a superset of JavaScript with a stronger optional type system for developers that compiles to JavaScript when run in the browser. Both JavaScript and TypeScript conform to ECMAScript, the standard for JavaScript and node.js, the runtime for running applications outside of the browser thanks to Google's powerful V8 JavaScript engine. JavaScript's impact on the web cannot be understated. Tech giants have thrown their weight behind the language. Besides Google's V8, there are open source projects like React from Facebook and Angular from Google, which help spread web applications across smartphones and desktop. After Netscape and Sun Microsystems -- where Java was hatched in May 1995 by James Gosling -- announced JavaScript in December 1995, Microsoft promoted Visual Basic (VB) as a standard for creating web applications using VB Script for its Internet Explorer browser. Oracle would go on to buy Sun Microsystems in 2008 largely to get its hands on Java and its huge development ecosystem. The press release about its launch from 25 years ago.
Just great. (Score:5, Funny)
Going to prove that intelligent design in a language is worth nothing when it comes to adoption and longevity, I guess.
Re: (Score:2)
Re: (Score:2)
And one of the reasons that JavaScript is still entrenched is that last I checked, a WebAssembly program still needed a JavaScript shim between it and the HTML DOM.
importing sucks (Score:5, Funny)
I just spent a day trying to import functions from a module into my html.
Like much of Javascript, it's a total mess.
But hey, however awful it is, it's not PHP.
Re: (Score:2)
Re: (Score:2)
Re: (Score:1)
Re: (Score:3)
Re: (Score:2)
But hey, however awful it is, it's not PHP
But my JS is generated by PHP!
Correction (Score:2)
Actually TypeScript transpiles to JavaScript, but anyhoo. To me it feels too haphazard...
Re: (Score:2)
To me it feels too haphazard
What? Haphazard's holdin' the whole operation together!
Designed in 10 days; decades of suffering (Score:3, Insightful)
Javascript, noun -- a programming language designed and implemented in 10 days [thenewstack.io] with years inflicted upon users due to shit design. It It is a "good" example of how NOT to design a language:
* Dumb hacks like "use strict"; to turn on error checking when a mis-spelt variable name is accessed. (And there is with no way to turn it off once turned on.) Gee, it like absolutely NOTHING was learnt from BASIC. .js files. Why did it take until 2015 for modules to be supported???
* Initially, no native ability to include
* Idiotic ASI (Automatic Semi-colon Insertion). As Douglas Crockford said @34:31 [youtube.com] says Why am I betting my career on this piece of crap? Whitespace should NOT break/change functionality -- something the Python idiots never got the memo on. Whitespace indentation is for the reader NOT the compiler / interpreter.
Here is a 3D example -- replace with whatever paradigm you use for your domain (Networking, etc.) The indentation conveys that there are TWO levels of functionality here. It makes it easier to spot the pseudo RAII pattern.
But I digress.
Why are we celebrating this shit programming language again? Because it won't die? It slowly inches along towards not being brain dead?
Re:Designed in 10 days; decades of suffering (Score:5, Insightful)
The only thing that could have possibly made Javascript worse was to move it server side. If someone had told me 20 years ago that I'd be doing server side JS, I'd have changed careers.
Re: (Score:2)
Reuse server validation logic on client (Score:2)
Nodejs doesn't give you features that other, better languages don't have.
Correct me if I'm wrong, but the two things I remember Node doing better are these:
1. A JIT compiler engine that very smart people have spent a lot of time optimizing. Python, by is usually interpreted.
2. The ability to write your authoritative validation logic once for the server and not have to rewrite it when putting pre-submission validation logic on the client.
Re: (Score:3)
Difficulty of finding the right person (Score:2)
Any language can be made to do the wrong thing if you put in the hands of the wrong person.
Correspondingly, most languages (including JavaScript), can be made to do the right thing if you put in the hands of the right person.
Perhaps what grandparent is trying to get across is that for someone trying to find "the right person" for a given project in a given city, this task is easier with some languages than others. Some languages have harbored unsafe programming practices, which in turn has led to being a larger fraction of candidates being the "wrong person." It's a lot easier to accidentally make CVE-worthy memory errors in C than in Rust, for example, making a smaller fraction of C programmers than Rust programmers "the right
Typescript solve it (Score:2)
Re: Designed in 10 days; decades of suffering (Score:2)
Sorry you are too stupid to handle white space and editor configurations.
(Never use tabs. There. Problem solved.)
Re: (Score:2)
> As Douglas Crockford said ...
And you conveniently left out what he said after. "If you can avoid the bad parts, the good parts are really really good and are worthwhile."
So, sure, you managed to add a little bit of spin on your argument and your arrogant assessment of the language.
Um ... (Score:5, Funny)
JavaScript's impact on the web cannot be understated.
I don't think that means what you think it means.
And replaced with what? (Score:2)
Would it be better to replace web applications as we know them in 2020 with 1995-style submitting a form and waiting for a full page reload? Or to replace them with native applications that work on only one operating system and have read/write access to the user's entire home directory?
Re: (Score:2)
If we had a decent state-ful GUI markup language standard, roughly 80% of the tasks/widgets we need JavaScript for would be handled directly by the standard. JS's suckage would then matter less because we'd depend on it less.
It's a Grand Missing Standard, and why doing web CRUD unnecessarily turned into rocket science.
Re: (Score:2)
If we had a decent state-ful GUI markup language standard
I'd be interested to read your proposal for such a standard.
Realistically, what'd probably happen is that everyone proposing such a standard would implement it as a proof of concept in the form of a polyfill in JavaScript. Then none of the proposals would be deemed compelling enough by the W3C to incorporate into HTML itself. Oh wait, that's exactly the situation we're in today with React, Angular, and other big web JS frameworks.
Re: (Score:1)
I'm working on a write-up that describes the features it would likely need.
I'm not convinced JS/DOM is powerful enough to do it well and consistently across browser brands. But if somebody can pull it off, that would be great.
I suspect the quickest route is to use the Tk or Qt kit to build a stand-alone GUI markup browser in C or C++. If and when it catches on, the bro
On a related note (Score:4, Funny)
Noscript turned 15 last May.
Happy birthday Noscript!
How would you fix JavaScript? (Score:1)
Can JavaScript's weaknesses be fixed without breaking backward compatibility? I'd like slashdotters' opinions on the top 3 fixable features they want and the top 3 unfixable features they want, where "unfixable" means significantly breaking backward compatibility.
Three feature's I'd like to see added is optional named parameters, an explicit class-like structure so one doesn't have to use anonymous function notation, and optional type-checked parameters, including a "non-empty" test. By "non-empty" I mean i
Re: How would you fix JavaScript? (Score:2)
No need.
As soon as WebAssembly gains the same browser APIs as JS, JS is dead and gone. It will be just compiling your favorite languag for the WASM/browser platform. In my case, I already do that with Godot Engine. (The trick is to automatically generate the foreign function imports from JS to WASM.)
Re: (Score:1)
WebAssembly is too often used by criminals to steal your CPU cycles. If it doesn't solve that, it will go the way of Java Applets.
Re: (Score:2)
This is typically done by writing in a different programming language that compiles to JavaScript. The most popular choice is TypeScript, as you've mentioned. There is talk of adding types to JavaScript but it's likely to be years away. And is runtime type checking needed in the browser? It seems static compile-time deals with most use-cases.
Probably won't be added, but there is Dest [mozilla.org]
Re: (Score:2)
Those are all terrible ideas...
> named parameters,
Seeing how badly these work in python, no thank you. JS gets all the power of named params using destructuring and none of the downsides
> explicit class-like structure
It already has that, despite OOP being a terrible idea.
> I like scripting languages with a type system that acts as if every value is stored as a string.
which is why tcl was such a failure
> And do we really need "NAN"? That's goofy.
Its a physical reality of ieee floating point num
Re: (Score:1)
> Seeing how badly these work in python, no thank you.
Example of failure? If Python did them wrong, then copy another language.
> which is why tcl was such a failure
No, the bad idea in tcl was using strings for everything, not merely variable values. I used other languages that did it mostly right, and found it cleaner. There were no "hidden" type indicators to second guess.
> As usual, critics of javascript are always just bad programmers.
If I'm a "bad programmer", I do just fine with the right lang
Complement to Java (Score:2)
I like the press release, "JAVASCRIPT AS A COMPLEMENT TO JAVA FOR EASY ONLINE APPLICATION DEVELOPMENT"...the name and hype building on complement to Java. It's always "easy" you notice no new programming language is designed (well mainstream as Brainfuck is designed to be what it's name implies) ever to be difficult. A prototype-oriented vs. object-oriented language, and a quarter century later both languages in use, but to quote a Robert Frost poem "Two roads diverged in a wood..." Java is in a very differ
Re: Complement to Java (Score:2)
It should be designed to be POWERFUL.
In case you are looking for such a language, look at Haskell. :)
Your brain *will* explode though. We pros have learned to enjoy it.
Re: (Score:1)
I concur. I've worked with "weird" and "freakish" languages like LISP, Prolog, Forth in my time (oops, showing my age) and yes Java and JavaScript are...well crude but they get the job done.
Yes, my brain exploded with Prolog, and then I did a LISP version of a Prolog system. A professor was so impressed (back when I was a college kid in the 1990's) I was working with CLIPS, the expert system shell.
I remember as a college kid I developed a functional language based on set theory, although more multi-sets. Fo
Perfect time for a superstar drug overdose death. (Score:1)
Remember, you get to thrash the hotel room first.
Just make sure you really die, Mr. Axl Javascript.
Still confusing JavaScript with Java (Score:2)
25 years latter, wer are still confusing JavaScript with Java, which was Sun's and Netscape's intention on the joint announcement.
Slashdot and arrogance - systemic in industry... (Score:2)
Seriously, you can hate on *any* programming language - and people do.
It's so damn boring.
This type of arrogance is systemic in the industry, but it is slowly being broken.
I recall working as an app developer in a primarily Java shop - 90% of the Java devs would just shit all over JavaScript - "It's not a real language"
They would refuse to learn or touch it - then again, they couldn't even be bothered to learn HTML. Lazy dinosaurs!
But there were a few - generally the better, wiser and more flexible Java dev
Re: (Score:2)
"The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man." -- George Bernard Shaw
> wiser and more flexible Java devs
FACEPALM. That's an oxymoron. If they were wise they wouldn't be using a shit language in the first place.
The fact that Java didn't get unsigned types until version 8 [oracle.com] is proof it was designed by idiots completely out-of-touch with solving actual day to day problems. C/C++ h
Re: (Score:2)
Touched a nerve there.
I'm 52 by the way.
But hey, you just keep ranting into your echo chamber, nobody is listening.
The fact is, code is being created - and it works.
The fact is, Java and JavaScript are amongst the most popular coding languages in the world.
Hey, so is Python - probably another language you would rant and rail against.
So, what is the deal here?
Everyone else is wrong and you are right?
Or, nobody is right - whatever it takes to the get the job done.
Whatever people *enjoy*, without being ranted
Re: (Score:2)
> Touched a nerve there.
Nope. Just tired of dumb people posting dumb shit.
> I'm 52 by the way.
And yet with all that experience you still feel the need to use and defend shitty languages??? You are _precisely_ the problem. You tolerate badly designed and badly implemented language, rushing off to yet-another-fad-of-the-month programming language.
> The fact is, Java and JavaScript are amongst the most popular coding languages in the world.
Quality != Quantity
McDonalds, with their BILLIONS served, "mu
Re: (Score:2)
Oh - and your Bernard Shaw quote is actually aimed directly back at yourself, it made me chuckle.
"Hey, throw in a quote to prove my argument." - you may want to ensure you choose a quote that proves rather than disproves your argument next time.
How so? Well, you are the unreasonable man in this argument.
Most JavaScript coders I know also use other languages. They are reasonable people. They understand there are many ways to find solutions, some better than others. They don't shit all over other solutions, b
25 years of confusing Java and JavaScript (Score:1)
An anniversary to grieve (Score:2)