# Is "Java" absolute garbage, or what?

**URL:** <https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968>\
**Category:** Factual Questions\
**Created:** [August 9, 2007, 5:27am UTC](https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968 "2007-08-09T05:27:29Z")\
**Posts on this page:** 5\
**Page:** 4

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [August 12, 2007, 10:09am UTC](https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968/61 "2007-08-12T10:09:35Z")

</div>

To be fair, some of that space was spent writing map, which you didn’t have to do in your SML analogue (one could argue that such a natural and useful function _should_ be a standard part of any language, but, whatever), and straightforward line counts are a bit misleading, when a slightly different brace-style would’ve removed quite a few of them from the Java. That’s the problem with trying to measure simplicity through brevity. The problem with this clunky code isn’t that it’s eleven lines long; the problem with this clunky code is that… it’s clunky.

(I agree with you on the sheer fear with which I imagine setting up, say, a usefully curried version of map along these lines)

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [August 12, 2007, 10:30am UTC](https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968/62 "2007-08-12T10:30:52Z")

</div>

**Rysto** : My point about MapReduce was that the functional _paradigm_ is extremely useful. The fact Java doesn’t support it cleanly (which your own example serves to illustrate) tells you something rather nasty about Java.

I could get really nasty and ask you to whip up ML-style pattern matching in Java like I can in Common Lisp. But I won’t, because I know that Java really can’t do it without reimplementing the entirety of the Common Lisp macro system, something equivalent to writing a complete and arbitrarily extensible Java compiler in Java which outputs Java source code. (It’s _extra_ nasty because writing a Java compiler is orders of magnitude more complex than writing a Common Lisp compiler.) However, I shouldn’t have to convince you that being able to write code like this:

```auto

(defun exists? (elt lst)
  (match lst
         (:nil nil)
         ((:cons x xs) (if (eq x elt) t (exists? elt xs)))
         (:t (error "~A is not a list" lst))))

```

in a language with no ‘native’ support for pattern matching after only a few minutes’ trivial work is a huge credit to the language.

And, before you ask, macros are _wonderful_ for condensing and making readable very large and nontrivial programs. Implementing control structures isn’t the half of it.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [August 12, 2007, 10:34am UTC](https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968/63 "2007-08-12T10:34:55Z")

</div>

[QUOTE=bob\_co]  
It’s not a compiled language.  
[/quote]  
Yes, it is. It is compiled to JVM bytecode and the bytecode gets compiled to native code by the just-in-time compiler at runtime.

> [@](#):
>
> Firefox used to be a good browser, but the simple fact is that after I add all the million add-ons that I want and never use, it barely functions.

I really shouldn’t have to comment here, so I’ll only say this has _absolutely nothing_ to do with Java.

---

<div class="post-metadata">

**Author:** ![black\_rabbit](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@black\_rabbit](https://boards.straightdope.com/u/black_rabbit)\
**Post date:** [August 12, 2007, 10:08pm UTC](https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968/64 "2007-08-12T22:08:47Z")

</div>

IANAP, just a sysadmin, so most of this thread is above my head. However:

1. JBoss is frickin’ awesome.

2. The Linux version of Lotus Notes is written in Java. :shudder:

Java’s level of suckiness depends entirely on the application and implementation.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [August 12, 2007, 11:13pm UTC](https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968/65 "2007-08-12T23:13:35Z")

</div>

[QUOTE=black rabbit]  
Java’s level of suckiness depends entirely on the application and implementation.  
[/QUOTE]  
No.

[Previous page](https://boards.straightdope.com/t/is-java-absolute-garbage-or-what/414968.md?page=3)
