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*
-
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.funkybro– funkybro2011-09-27 13:28:19 +00:00Commented 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.kevin cline– kevin cline2011-09-27 14:18:37 +00:00Commented Sep 27, 2011 at 14:18
-
1It'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!funkybro– funkybro2011-09-27 15:12:34 +00:00Commented Sep 27, 2011 at 15:12
-
1Does 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.Erik Reppen– Erik Reppen2011-09-30 22:55:44 +00:00Commented 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.funkybro– funkybro2012-08-08 09:03:52 +00:00Commented Aug 8, 2012 at 9:03
|
Show 8 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
default