Actually it was designed to run on washing machines, refocused to work for browser applets, and then refocused again to deal with massive enterprise apps. I'm not sure it was ever suited to any of those tasks -- it's merely has a good enough cross section of features. One only has to look over at what Microsoft has done with C# to see that Java could be significantly less verbose.
Judging a numeral by a standard it was never designed to meet is pointless. If you want to decide whether Roman numerals are a good number system or not, see if you can hammer them onto a building. I'd say you can. I may not like working with Roman numerals for grocery receipts, but that doesn't make them bad.
Actually, Roman numerals were designed for counting the men in your army, whereas Arabic numerals were designed for mathematics. Comparing the two isn't a good argument against redthrowaway's point at all, because both are better at the task they were designed for.
Are you saying that Roman numerals are better for counting than Arabic numerals? I suppose you don't mean count (I, II, III, IIII, V...), but show the number of men in the army. I don't see any advantage in using Roman numerals.
Lets say we divide infantry in XXX maniples of CXX men each, supposing they are complete and you haven't lost people yet in battle. How is that better than 30 maniples of 120 men?
Otoh, arabic numerals are a lot easier to multiply/divide. Before the wide adoption of arabic numerals all but the most educated couldn't perform simple multiplication/division.
111
948 948
289 => 289
--- ---
1237
thanCMXLVIII plus CCLXXXIX => CMCCXLLXXXIXVIII => MCLLXXIXVIII => MCCXXXVII
but it may be that it's because what I'm used to.
Your way ends conversation and attempts to belittle, my way makes the point in a way that allows for discussion.
In real life I do dislike java and try hard to avoid having to use it, precisely for the reasons highlighted in the OP. I do like Haskell, and many other things. Note: all the real Haskellers are nice and would never be as snarky as I was.
Actually it was originally designed for embedded system with limited resources [1].
[1] http://www.oracle.com/technetwork/java/javase/overview/javah...
List even = new ArrayList();
for(int i : new Integer[]{1,2,3,4})
if (i%2==0) even.add(i);
Still larger than necessary, and this doesn't have all the necessary class cruft, but still much smaller.Stolen shamelessly from https://gist.github.com/817635
That's a big difference.
However, since Java was not intended to be a scripting language, then it should never have monopolized the material of introductory programming classes like it did. I consider Java to be a very ungentle introduction to programming when compared with Python, Ruby or Scheme.
Although hopefully a dept as engaged in taking CS pedagogy seriously will teach a top-notch course in both.
Emphasis added. Ensuring that students have a sound grounding in the basics and can then focus on the new material in later classes seems far more relevant to the goal of teaching computer science.
Universities focusing on throughput and employability is the problem, not the solution. It shouldn't be 4 more years of high school ...
First class functions aren't a feature particular to scripting languages. Many compiled languages also have them, such as Haskell, Ocaml, Scala, F#, C#, D, Go, Forth, Common Lisp, and so on.
> It was never designed to solve quick little problems in a few lines
C# wasn't either, but it manages to be pretty expressive for what it is. I don't think you can argue Java's design precludes it from having basic things like first class functions, when (a) C# operates in the same market and already has them, and (b) Java 7 is going to be getting them.
You're right, we can't be saying that a language sucks because it doesn't look cool in some coding styles. Is like trying to do fancy OOP in pure scheme or common lisp without the CLOS!
It is a legitimate complaint. Having to write loads of boilerplate makes the code more difficult to read and understand, and increases the surface area for bugs to sneak in. That's true for both one-off scripts and huge enterprisey systems.
I routinely interview programmers of all kinds. Extremely few Java programmers ever make it because they simply don't know how to get simple (but non-mainstream) algorithmic tasks done.
One of my beliefs is that we shouldn't think about "scripting languages" versus "compiled languages" and just think in terms of what would make for the ideal programming language, period. By that standard, Java is inferior to Python (to pick just one example) because it is so much more verbose and formal when accomplishing the same desired task.
Generally, typing extra stuff to make my code work isn't one of the problems I have.
x86 assembly IS terrible because string concat takes many loc. I use x86 assembly to solve problems where speed is paramount, string concatenation generally isn't one of those problems. Like lets say you need to reformat a little endian RGB pixel into a big endian RGB pixel, then that's something I'd use assembly for.
Java as a language is horrible language because the only problem it solves well is how to inflate a consulting bill, or how to waste developers time figuring out what exceptions a method throws. Only exception a method needs to throw is JavaOutTheDoor.
Solving a problem in java is like winning a race where your legs are hobbled, yes, it's an accomplishment, but wouldn't it have just been smarter to untie your legs? Java was invented in 1994 or something like that, and the scary part is it hasn't changed. Perhaps I should still code my C K&R style?
You hover your mouse pointer over the method call and a pop-up window tells you what exceptions it can throw.
Better yet, right click the method call and tell it to insert the try and catch block(s) for you.
This is how professional Java developers work. It only takes a few seconds.
Judging a language by standards it was never designed to meet is pointless. If you want to decide whether Java is a good language or not, see if it solves the problems it was designed to solve. I'd say it does. I may not like working in Java for small projects, but that doesn't make it a bad language.