61 comments

[ 3.3 ms ] story [ 146 ms ] thread
>They require different plug-ins.

I wonder what JavaScript plugin is the best

I thought there was recently a speed test showing V8 to be the fastest. Your definition of best may vary, and my recollection may be wrong.
I installed a JavaScript but it conflicts with my RealPlayer plugin!
Yeah, that line made my mind go blank for a moment.
At least the Javascript plugins don't want me to install the Ask Toolbar when updating.
NoScript (;
(comment deleted)
1998 called and wants it's "scripting languages" back.
Java - Write once, debug everywhere.

JavaScript - Write once, run everywhere

This should be the other way around actually.
JavaScript - Write everywhere, run once?
Until the first error in the console ;-)
Indeed. As much as people love to bitch about Java, I've never had to patch applications because it was on a different platform.

Javascript however... Let's just say that you can count on IE to make sure you'll have to patch your code at least once.

That is one painful page
TRUE, that is all plain wrong, amazing ;-)
Personally I enjoyed all the whitespace in the XML source.

Props to mozilla.org for ensuring that dinosaur of a link keeps working!

TIL that scripting languages are distinct from programming languages.
Also that JS can only run in a browser, and that it requires a plug-in.
Also that Java is compiled and JS is "all in text".
That one is at least roughly accurate. It's poorly worded, but the idea it is trying to convey is at least true.
(comment deleted)
sort of thing a high school football coach, assigned to teach computer science over the summer, would write on the chalkboard for his students to memorize for the exam.
What the page should have been:

    How is JavaScript the same as Java?

    They both start with the letters J, A, V, A.
(comment deleted)
There's a typo on the first point. Instead of, "Java is an OOP programming language," it should read, "Java is an object-oriented OOP programming language."

That aside, it's a wonderfully enlightening document clearly written by someone well-versed in the issues. :-D

If anything, it should read "Java is an OOP language."
If anything, the whole post should be deleted. Then again, it's Oracle, so who cares?
At first I thought you wanted to mean "Java is an class-oriented OOP programming language", but then I heard the whoosh.
>JavaScript code are all in text.

Is Java bytecode not text based? If not, how would you classify it?

No, it's an array of bytes. Disassembled Java bytecode could be considered text-based, but I'm pretty sure the actual class files are considered binaries.
Of course, Java code is all binary, not at all human-readable or writeable. And there are not compilers for Javascript (except for a few JIT compilers in Safari, Chrome, Internet Explorer, and maybe Opera).
Actually all modern browsers and standalone interpreters like node.js have a JIT compiler for JavaScript; and while Java's bytecode is still not a machine code and is also JIT compiled by the Java "virtual machine", both languages are equally "scripting" or equally "non-scripting" (wherever you want to put the "scripting" line).
I guess I shouldn't have left off the <sarcasm> tag.
Is there a historical reason the page is 'java_javascript.xml' but returns an HTML document with text/html mime type?
(comment deleted)
They might have static xml files on server and XSLT template engine to produce html
I used Java for 7 years and got burnt out with programming because of the amount of upfront design effort required. I would never start coding because I knew my architecture wasn't abstract enough and refactoring it later would be hard.

JavaScript was a breath of fresh air. I could start hacking without thinking about the design, but instead focusing on simplicity and the problem at hand. Refactoring later was trivial.

A big part of this is that whereas Java is OO, JS can start out procedural, evolve to be OO and then go functional, all within the same project.

I'm now churning out more quality code than ever at https://starthq.com

>> I used Java for 7 years and got burnt out with programming because of the amount of upfront design effort required.

That is essential for any software engineering project (and is almost the definition of `engineering`)

>> I could start hacking without thinking about the design

o.O

>> Refactoring later was trivial.

I've never heard someone say that about JavaScript -- in fact, I've heard just the reverse. Java tooling makes refactoring much, much easier. Not so for JavaScript.

Just being honest here! This is my experience after coding in different contexts for 23 years. Your mileage may vary ;)
You're right. As much as people rail on java here, it still has some of if not the best tooling in the industry.

You can make javascript pretty easy, but the process is a bit more involved (not a bad thing to know your own code though.)

It makes me happy to be able to use sublime for all my programming but java.

That being said, I have to agree about the design though. You're only shooting yourself in the foot if you just start coding right away. Even just 10-15 minutes of design up front to understand what the heck you're doing will save hours down the road. I think it's more of a problem of balancing the 2.

Some people overdesign and don't get anything done while others just do everything and end up with code rot and technical debt later.

Of course one needs to think about the problem up front, especially in JavaScript. The problem with Java was that due to the fact that it's not dynamic, it was easy to get carried away creating abstract base classes and interfaces, or worse yet using generics to build up the foundation for what you actually wanted to do, before you wrote any code that was useful.

In JS, the focus for me is to get something that gets the job done in as simple way as possible, and then work to make it more generic.

I could understand you getting burned out on it. I'm lucky to have the flexibility to decide when an actual class hierarchy is needed. I'm also a spring user (mainly for dependency injection and the ability to hot change things at run time). If you don't go overboard with the interfaces, it's not too terrible (still not ideal compared to what I'd consider more modern languages though) It's still my language of choice for data crunching though. I also use python and node/frontend js on a daily basis.

I can't wait till I get enough of a break to migrate that over to scala.

You need to learn Clojure. I would bet since you've been a developer for 23 years you've probably tried Clojure already - especially since it's popular among the Java/JVM crowd. Here's why, in the context of your post, I think you would like it:

1) Is dynamic like JavaScript, the learning curve for a seasoned developer such as you would be low and you'd get velocity quickly

2) Allows you to focus on the problem solving at hand rather than spending a bunch of time just build base classes to model your solution

3) Refactoring is easier as Clojure puts you on the road to pure functional programming, and your solution is not complected (or at least has low complection)

4) Has a nice interactive environment for prototyping/developing, much like some of the JavaScript tools out there

5) Can emit JavaScript for the browser using ClojureScript

Thanks for the advice! I have toyed with Clojure, but the idea of functional programming without a procedural escape hatch for any real world project puts me off a bit after doing ML at university.

What would be the best book to read to get me excited about Clojure, in your opinion?

There's several good Clojure books. I'd start with Rich Hickey's video "Simple made Easy":

http://www.infoq.com/presentations/Simple-Made-Easy

The "Joy of Clojure" is the best book on understanding the mid and high level constructs and design of Clojure (and FP). It's not a beginner book though - for that the books from the Pragmatic Programmers or Oreilly are excellent.

I also love Clojure, but I would recommend learning Scala. Its essentially a vastly improved Java. Or you could say its vastly improved on many previous languages. But at its core it is Java (JVM).

Its easy to read, succinct, functional or OOP when you want it to be, and you can work directly with any java library. Its really a well designed language.

The only downside is that the compile time is very slow, whereas with Clojure you can develop on the fly.

The downside to Clojure is that the code is very dense to read. But if you have the time I also strongly recommend playing with it for a week.

Scala play! is a pretty good web framework.

>Java code needs to be compiled while JavaScript code are all in text.

Well, one correct bullet point out of four is, uh, I guess it's better than zero.

Can we just start calling the language "JS" consistently? Other languages get to escape from their stupidly-named origins, such as "Personal Home Page".
Didn't it have something to do with cars and carpets?
Anyone can find out how Java is different from Javascript in about 30 seconds.

What I would like to know is WHY THE FUCK JAVASCRIPT has the word JAVA in its name?

I remember reading somewhere that it was to piggy-back on Java's popularity.
In the same way CPP was only a way to cash on C's popularity.
Why is there Java in Javascript?