Is "Java" absolute garbage, or what?

Like I said, Java GUIs aren’t always responsive.

It’ll only be in software where the consequences of failure would cost millions. Stuff for the space program, for instance. Even that doesn’t guarantee results. Formal verification can prove that your problem conforms to a formal specification, but it doesn’t prove that your specification actually specifies what you want it to do.

Depends what you mean by “proven”. A large subset of the Java language itself has been formalised in Isabelle and proven type safe, for instance (see the Archive of Formal Proof). If we’re talking individual programs, then I don’t know of any non-trivial examples.

The market for formal verification (the ‘proof’ I referred to above) is large enough to support special-purpose tools that verify software.

Disclaimer: CS doctoral candidate who mainly programs in Java. Hopefully, I can learn something here. :slight_smile:

Yes, it was released too early. Most glaringly, this was indicated by the primitive types not being objects; sort of solved with autoboxing, although at a significant performance hit. Furthermore, the added complexity and odd ways of bouncing between them is terrible (and leads to some non-intuitive bugs). But what other forms of “anti-Object Oriented Programming” are you speaking of? And why do you say the error-handling system is “completely messed up”? Are you referring to the ongoing checked exception debate?

Yes, I suppose the software is constantly being revised, which can cause some odd (and difficult to debug) issues. AFAIK, nothing comparable to the move from gcc 3.x to 4.x, though. Not that this is an excuse, but software is (almost always) under constant revision. Again, that doesn’t make it desirable, but it is somewhat understandable.

Beyond the primitive/object issue I brought up, what other major fixes are you speaking of?

There are a few things about which I have to agree with you here. For instance, (almost) anytime I’ve tried to use parts of the nio package it was such a hassle that I found a different way to approximate it (non-blocking, non-GUI IO, for example). But it’s rare that I encounter anything like that day to day. Are there specifics you had in mind?

Sure, but the same can be said of anything, right (says the TA who has suffered through grading Java, C++, Scheme, etc. code)? Or is there a particular feature or characteristic of Java that you’ve found specifically lends itself to badly written code?

I’m not convinced, and the animosity directed at Java always baffles me. There are tons of good things about Java; note however, that while I do like Java, I wouldn’t claim that it’s the solution to everything – it’s certainly not the right tool for every job. But, on the other hand, the claim that it’s “absolute garbage” makes me suspect a serious error is occuring on the non-computer side of the keyboard. :wink:

Operator overloading is a big one - it was pureposefully left out lest it confuse programmers :rolleyes:. Lambda expressions are another (indispensible once you’ve used them) - although I think these may have been added, or be added soon, I know there was an approximation using anonymous classes. Objectitis is another issue. What takes one line of code in any other language takes about five in Java, due to having to instantiate about fifty objects. Completely unneccessary and it doesn’t even make sense - in what way is Math an object? The strict adherence to OO is stifling and prohibits experimentation into other programming paradigms easily (even C++ allows a limited form of functional programming through boost.lambda and the STL). Again, looking at templates/generics/parametic polymorphism - Java’s version will only work with objects, not primitives, AFAIA, making the code at the bottom of this post almost impossible to implement.

But again, Java’s a language that’s ignored pretty much all the advances made in programming language design over the past forty years, instead attempting to make a coherent language out of C++. For instance:

datatype 'a BTree = Empty | Branch of ('a BTree) 'a ('a BTree)

fun member item Empty = false
   | member item (Branch a b c) =
     if item = b then
    else (member item a) orelse (member item b)

[li]No first-class anonymous functions. Remedy that deficiency and Java is pretty close to being a pretty good language.[/li][li]Algol-like type system. Either emulate the ML family and get a type system that actively helps you or emulate the Lisp family and save the programmer from fighting his own type declarations. A proper numeric tower is essential regardless.[/li][li]Horrible, horrible syntax. Weapon.Handgun.pointTo(Person(Me).Head).Fire(). Lisp has better syntax, and Lisp doesn’t have syntax.[/li][li]Bad object system. Steal Javascript’s. Javascript, removed from the abusive environment of web browsers, is a fairly nice language in the ways Java is not and has a very good object system.[/li][/ul]

Revenge of the Nerds. – The source of my Steele quotation above, and a good explanation of why Java is as popular as it is. It’s important, so I’ll quote it here:

Execution in the Kingdom of Nouns. A rather scathingly funny rant about Java’s object system.

The design flaws of the language have nothing to do with the user experience.

They do if the language forces programmers to use sub-optimal design to achieve the stated goals.

So basically your complaint is that Java isn’t a functional language.

Well they are definitely not part of the solution.

Java is absolute garbage, but it’s absolute garbage users and developers alike put up with, often without realizing it. Even on the most modern, powerful personal computers starting the simplest Java application is slow. Why? Mostly because developer’s mental benchmarks aren’t calibrated properly :slight_smile:

I do a lot of optimizations of other people’s code for a living (among other things) and usually have very high standards for good performance. Even putting Java and Windows aside, somebody like Apple has absolutely no fucking excuse for having their computers not be able to do a boot to desktop in under three seconds.

Before I got into manual optimizations I used to wonder "Geez, what the hell is it doing. " The answer in 99% of the cases is “Something stupid in a profoundly stupid way.” I don’t know what the hell Java VM is doing when it’s loading, and frankly I’m afraid to find out. If somebody is willing to present to me why it’s impossible (or even really really hard) to launch the Java VM (without any sort of preloading, first launch) in under a second even on a meager machine, I would certainly like to know. I don’t have the desire, resources or time to fix every single piece of retarded code but unfortunately slow programs serve as reference benchmarks for other slow programs and the cycle continues.

As long as the new version has more features or “ooh shiny” factor as compared to how much slower it is, it’s considered fine. The utter unwillingness of developers to properly add those new features is a little discouraging. My 25Mhz 386 laptop with 4MB ram booted into windows 3.1 in under a minute and I could launch MS Word 6.0 and be ready for typing a document within 5-10 seconds. My 1.4 Ghz laptop with 1GB ram boots into Windows XP in a little over a minute and I can launch MS Word 2003 and be ready for typing a document within 5-10 seconds. My friend’s 2.4Ghz dual-core laptop with 2GB of ram boots into Windows Vista in a little over a minute and can launch MS Word and be ready for typing a document within 5-10 seconds. The only new feature I’m consistently using when booting and starting MS Word is supporting a larger number of display pixels (yet still at our state-of-the-art-in-1978 PPI).

There’s a meme around embedded developers is that 30ms is the longest amount of time something can take and still seem instant to the end user. Even if it’s not the exact number that seems reasonable. My PC can’t even launch a second instance of Notepad or Calculator in under 30ms – what fucking year do we live in? 30ms on a 1.4Ghz machine is 42 million cycles. Even being generous and assuming a horrid IPC of 0.1, that’s still 4.2 million CISC instructions. Even assuming Microsoft or Linux people do not know what a file system cache is, the hard drive latency does not exceed 15ms. :mad:

It has to load all of the system classes into memory. It probably goes on to compile the bytecode into machine code – and compiling isn’t an instantaneous process.

Edit: They probably could optimize this – but the primary market for Java nowadays is server side stuff. The JVM is launched once when the server boots and then just keeps running forever. Nobody doing server stuff cares about knocking a couple seconds off of startup time.

Wow, that’s some pretty generic venting against slow modern computers. Don’t see what it has to do with Java.

Well I know what it’s doing literally, but that’s a disingenuous answer. Kind of akin to

Q:“How the hell did you manage to spend $250,000 in one afternoon?”
A:“Well, I got a haircut and some ice cream.”

Because even if Java was perfect, everything underneath it and on top of it is profoundly slow, so it wouldn’t be all Java’s fault, but I don’t think they’re even trying.

Yeah, that’s pretty much the vibe I’m getting. Although there is an ongoing debate about adding closures to the language, which addresses some of that.

Yeah, we’re complaining Java’s thirty years out of date.

There is a (semi)good point here. Yes, the JVM has to load all its system classes during initialization. That’s the price of using a VM – there are costs (memory use, load time, performance) for the benefits (hardware-independent standardization, process isolation, sandboxing). A pretty classic tradeoff, IMHO.

A huge issue with startup was that each instance of Java had to load all it’s classes during initialization – no shared code among processes. But that’s been addressed since 1.5 (see: class data sharing) at least to a large extent, work is ongoing, I believe). Doesn’t eliminate the issue, but does mitigate it. But again, if one wants to work “close to the metal” (e.g., on embedded systems), use C. And deal with the attendant issues (cf. shooting yourself in the foot; that always entertains me).

Common Lisp isn’t a functional language. Neither is Javascript. However, both of them support the functional paradigm much better than Java does at this point.

My complaint against Java is that it locks programmers into a paradigm that isn’t really very useful compared to a lot of others that have been invented over the past five decades.

Your complaints might have a bit more weight if the vast, vast majority of commercial programs weren’t written in those “30 year out of date” languages of the C family. Especially when one considers that second place on the list would go to web scripting languages.

If functional programming is so much more efficient than imperative, why aren’t there companies out there using functional languages and kicking the ass of those out-of-date companies still writing imperative programs?

The vast majority of software is written in COBOL.

Google. MapReduce. Search for it online sometime using the search engine of your choosing.

Don’t be so facile. There’s good reasons why the C family has come to dominate. Chief amongst them being:

C was one of the first major languages invented. There’s millions of libraries written in C. The C family dominate today because they dominated in the past. It’s a self-fulfilling prophecy.

C’s syntax is familiar to virtually every programmer on the planet. Retraining programmers familiar with C in Lisp or Haskell is going to cost money.

Functional programming languages generally need far more sophistication on the part of the programmer to master. Most functional programmers come to be acquainted with the basics of domain theory. Haskell’s foundations lie on category theory. Virtually all strong statically typed FPL’s use a variation on Hindley-Milner typing - again, a knowledge of basic type theory will help in the design of programs. Epigram requires quite sophisticated type theory to master (dependent types, and all).

The likes of Java and C# are backed by massive corporations, who are able to advertise. When was the last time you saw an advert for Prolog - an “academic” language? (Although, it’s funny, C# continues to become closer and closer to a functional language with every new update - lambda expressions, limited type inference, parametric polymorphism etc. etc.).

Although, really, what has this got to do with the glaring deficiencies in Java that I’ve pointed out and you’ve still not addressed? As if pointing out that lots of software is written in Java somehow makes these false…