Hacker News new | past | comments | ask | show | jobs | submit login
Java Vs. JavaScript (metafilter.com)
143 points by rkwz on Sept 10, 2011 | hide | past | favorite | 23 comments



Actually, it wasn't 10 days. As I recall (and I was at Sun at the time in the 'liveoak' group which was to become the Java group) Netscape already had been thinking along these lines and something they called 'netscript' which was their view of how to increase the interactivity of web pages. The original suggestion was to flush it and go with Java to fill this niche, but it was pointed out that having a 'light weight' interpreter already in the browser was useful when all you needed was a "little" interactivity (like a pop up over a form field to tell you what it wanted). No doubt somewhere I've got a 1/4" (QIC) tape with my old Sun email which would let me tell you definitively but that is my recollection. There was concern that people would not know which to use 'netscript' or 'java' and so somebody (and I don't recall who) suggested it be called 'javascript' so that it would be clear it was a lighter weight way of adding interactivity than 'Java'. (most folks at the time thought of 'scripting' languages as light weight languages). The thought being "If its small and trivial just do it in javascript, if its bigger and more sophisticated step up to the power of Java." At the time I don't think anyone anticipated how much could be put into Javascript, nor how tight fisted Sun would become around Java.



IIRC it was called Livescript.


I believe you are correct.


Sorta funny how things work out.

Berners-Lee probably had no idea that his little invention could end up making the Internet relevant to billions and basically sidelining Microsoft.


"Hackers gonna hack!" :D


I love the whole tone of the article and how Brendan Eich is painted as the hero. Because he is. He managed to make a language that, despite its simplicity, is still in its peak after 16 years of heavy mainstream usage.

I discovered functional programming because of JavaScript (via Joel Spolsky, in 2006!!) and I must say something: Thank you Brendan.


Java is to Javascript as car is to carpet.


Car is to CARriage..:)


So Java is a more modern form of JavaScript? Don't think that comparison is sound...


Summary: "kind of, but not really." Only in the comments is the name LiveScript mentioned. I remember actually playing with JS as LS in the Netscape 2.0 days.

So the gist is kind of there, but if you want actual history I'd suggest :http://en.wikipedia.org/wiki/JavaScript#History


That's a nice little bit of history there. Not sure how much apocryphal and how much true though.

As I understood it one of the reasons js really took off was Microsoft's addition of XHR requests. Is that right?


Yep, you're right!

"The concept behind the XMLHttpRequest object was originally created by the developers of Outlook Web Access (by Microsoft) for Microsoft Exchange Server 2000." - http://en.wikipedia.org/wiki/XMLHttpRequest


XHR was introduced many years after js was extremely popular. Also XHR doesn't add anything technically. The same thing can be achieved with dynamically adding <script> tags, or using an iframe, or a number of other methods.

The introduction of the buzzword 'ajax' certainly popularized what people had already been doing for years though.


The pre-XHR methods were super-clunky though. The technical contribution of XHR was to provide a standard and clean way of programatically sending HTTP requests in the background without refreshing the page. Without XHR or something like it, I don't think browser-side applications would have taken off the way they have.

It's a shame the Microsoft engineers hadn't thought of making websockets instead. Bi-directional communication would have been useful for the web-based version of Outlook they were supporting, and it would have become available to the rest of us much earlier.


And XMLHttpRequest was the replacement for an earlier applet-based method called 'Remote Scripting', which was pulled when MS lost the Java lawsuit. (And contrary to what DougWebb said, it worked pretty well.)

Remote Scripting itself was a copy of an IBM applet which Netscape pushed in the v4 timeframe (although practically, NS4 was too unstable to do any real dynamic html.)

So it really was the "AJAX" branding effort that got devs to notice what had been under their noses for some time.

("MSRS" now stands for something else entirely, but here's an old article discussing pre-historic AJAX techniques: http://www.ibm.com/developerworks/web/library/wa-resc/ )


"Describe the difference between Java and Javascript" is actually one of the first technical questions I ask when hiring developers (or otherwise evaluating the skills of anyone in a technical, Web-related position.)

When I first tried it, years ago, I was a little embarrassed for having asked, because I figured everyone would know the correct answer. Then several candidates totally blew the response, and I realized just how good of a filter the question really is -- and continues to be.


Try asking them to explain the difference between GET and POST. It can be enough to know exactly how good the person sitting in front of you is.


What do you expect as an answer here? Just a basic grasp of what they're for, or a deep computer-sciencey appraisal of the sorts of languages they are? (If the former, you'd really hope those people wouldn't be making it to interview...)


I should clarify that I ask this during an initial phone screening. (Having HR personnel ask the question never seems to work because they don't know how to evaluate the response, which can vary and still be correct.)

What I'm looking for is mention of the fact that Java is fully object-oriented and, these days, primarily used on the server side. (Though some mention of the history of -- and problems with -- applets is good too.) For JavaScript, some mention of AJAX, jQuery, Node.js, etc., are all helpful.

Essentially I want to know if the person truly understands the pros and cons of each and when to use each, as opposed to just having a shallow understanding that "they're different languages". I'm still shocked at how many Web developers can't offer more than the the latter.


What, no mention of "HotJava"? (just to sully the waters)


Love javascript. My friends brother works with Brendan at firefox. The fact about him being a genius is true.


Your tone is absolutely brilliant!!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: