Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • 5
    "Javascript code is about one-fourth the size of equivalent Java code" <-- this is the problem! Sure it's fast to just create anonymous functions and add extra properties to objects, and throw them around like confetti. But what about when someone else visits your code and tries to figure out what is going on? Besides, more code in Java does not necessarily equal more typing... Eclipse writes so much of it for you. Commented Sep 27, 2011 at 13:28
  • 3
    @funkybro: Eclipse writes it... then I am stuck looking past it for the life of the project. If it's required, but a trivial plugin can generate it, that's a language smell. You are right that Javascript classes require a bit more documentation. But just knowing a Java method signature isn't sufficient either. Commented Sep 27, 2011 at 14:18
  • 1
    It's not required! You could simulate Javascript in Java by always invoking methods with reflection, and using nothing but plain objects, lists and maps if you really wanted to. However most developers IME (not all I confess!) choose to define meaningful data types, as they find it helps them write maintainable, self-documenting code! Commented Sep 27, 2011 at 15:12
  • 1
    Does reflection allow Java to modify objects during run-time? How about closures? Learn the language before you criticize it or assume Java, the most closed-paradigm language outside of assembly is capable of emulating it. Commented Sep 30, 2011 at 22:55
  • 2
    @kevincline And "the awfulness just happens on a larger scale" is no longer the case, which was the point of my original question. Javascript is no longer confined to trivial browser input validation scripts. It is becoming more widely used on the server side, which means that the "horrible, unmaintainable copy-pasted piles of WTF" of the future will have no tooling to help us pick up the pieces. This terrifies me. Commented Aug 8, 2012 at 9:03