3 ms·
Why not, you have started it.) Before down-voting and replying, please, copy and paste examples from the Rosetta Code website, which would prove my statements
by dschiptsov 12y ago
Why not, you have started it.)
Before down-voting and replying, please, copy and paste examples from the Rosetta Code website, which would prove my statements to be incorrect.
1. Syntactic noise.
2. Verbosity.
These gives us lots of cryptic lines of code, full of design patterns and other kluges. This is also related to the two below:
3. Over-abstraction.
4. Everything must be a member of a class.
These two are simple and straightforward. These few pages long stack traces is a result of these unnecessary method calls.
5. Static typing makes our code safe.
This nonsense results in even more lines of cryptic code ("generics") and even longer stack traces.
I am not talking about XML configs, over-"engineered" components (beans, servlets, etc.)
Here is a lemma: Any algorithm (at least those represented on the Rosetta Code website) could be coded with less lines of code, less words per line, less "special symbols" (with much better readability) and executed with less memory waste (this one excluding scripting languages for obvious reasons) in any other mainstream language. Period.
Sure, Java does not suck. It is stupid us, who are unable to "get it".
- Crito 12y agoNot that I typically defend Java, but I think that (going by your Rosetta Code algorithm comparison test) Java fairs well against a few mainstream languages: Rosetta Code's Java Quicksort: http://rosettacode.org/wiki/Sorting_algorithms/Quicksort#Java http://rosettacode.org/wiki/Sorting_algorithms/Quicksort#Jav... Not great, that first line is a wreck in particular, but not terrible either. Compare that to this though: http://rosettacode.org/wiki/Sorting_algorithms/Quicksort#C.2B.2B http://rosettacode.org/wiki/Sorting_algorithms/Quicksort#C.2... Really quite ugly looking code. Now, this isn't entirely fair; one of C++'s faults/benefits is that depending on your shop and/or framework/libraries, "idiomatic" C++ can vary greatly. Template heavy C++ tends to look like vomit. C++ that uses Boost will typically be more unpleasant to look at than C++ that uses Qt (imho anyway). Java really comes into it's own horrible self when you get beyond mere algorithm implementation. A quicksort method in Java will tend to be relatively fine, but for projects larger than that it becomes idiomatic to make your java code a real mess.
- cheepin 12y agoQuicksort looks significantly better in a functional style. Here's some Haskell, but it certainly doesn't use any Haskell-exclusive features: quicksort :: Ord a => [a] -> [a] quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) xs
- Crito 12y agoDefinitely. Pointing to C++ as a mainstream language that is uglier than Java seems a bit like missing the point since it is basically the exception that proves the rule, but he did say "in any other mainstream language. Period." ;)
- loqi 12y agoWhen is quicksort not quicksort? When it's not in-place: http://augustss.blogspot.com/2007/08/quicksort-in-haskell-quicksort-is.html http://augustss.blogspot.com/2007/08/quicksort-in-haskell-qu... I love me some Haskell, but this particular example is kind of a bait-and-switch.