I don’t like Java. I have a hard time to explain exactly why I feel this way, but when facing a Java program or just thinking about doing something in Java I feel nothing but panic and dislike. Why is this? I have to admit that due to my general dislike I’ve never done any major Java developments so my feelings are based on occasional hacks and works and not years of punishment.
Java in itself isn’t terrible as a language I think. It is basically C++ with some of the worst parts removed. It is in fact made so simple that nowadays when all people learn Java at school and not much else, we see people getting out lacking clues about much in how computers and low-level stuff actually works.
What I find annoying is that there’s hardly ever any Java-related problem or program that isn’t on top of 22 layers of existing packages – giving me the feeling I’m building a house of cards.
Running a program with the help of a humongous run-time environment isn’t exactly what I like either. It makes the startup-time terrible and it makes the system/memory requirements far bigger than I like. Also, whatever Java-people try to throw at us, everyone that runs Java-based apps on their PCs or in their phones or wherever knows that Java is slow when used in real-life. Period. (Cute quote from Steve Jobs: “Nobody uses Java anymore. It’s this big heavyweight ball and chain.” – not that I believe he’s right in the first part.)
I dislike how everything in Java seems to always be depending on this and that version and this and that doesn’t work in this and that version etc and it’ll all be fixed in the next release. I don’t like how Java programs can’t be built normally with make, I hate the XML-mess called ant, I’m not friends with using GC-only for memory handling and I don’t like how Java is the run-time, the class-library and the language itself all together.
The fact that Java wasn’t at all possible to do completely open source until very recently of course has always kept me reluctant as well, and even if this situation now has changed the marks still live in me.
Of course, I’m never really much of a friend of OO in general as it is commonly used either, as some of the primary premises of OO is quite the opposite of my own beliefs: I don’t believe in hiding what’s is actually done, and most of the OO works, interfaces and inheritance etc are designed and implemented exactly to hide what is actually being done underneath from the users. I want interfaces and APIs that are clear and that makes the user of them understand what the functions do, and I want the actual source code for the functions and libraries to be easy to read and the flow of the code to be easy to follow. OO actually makes following code flow harder.
This of course shows my “on the metal” state of mind and the fact that I never do very high level application development or similar, but the few times I’ve for example looked around in and worked with the Qt source code (C++) it has made me go completely bonkers. I’ll remain working near the hardware and the OS and mostly on resource-restrained systems. I remain with and I really prefer plain C. For scripting situations, I like perl. This way I won’t have to do any Java.
To me, comparing C with Java is like comparing motorcycles with cars. ‘Course a Ducati is fast and compact, but a Volvo is comfortable and offers room for bags and family.
The focus must be on the target. It is stupid to develop in C a clustered platform with complex business logic, which uses several enterprise resources and must be world-wide accessible in the most disparate ways. Likewise, it makes no sense to develop a project like Rockbox using Java.
Personally, I find programming assembler on m68k fascinating. Yet, the elegance and readability of a well-conceived Java program is unique.
Ciao
Luca
PS
On the C++ book from Stroustrup there’s a clear and compact presentation of programming paradigms (chapter 2, can be read for free at http://www.informit.com/articles/article.aspx?p=25003). It’s a very interesting read!
I don’t think of it as a comparison of languages, I think of it as expressing reasons why I don’t like Java to the extent that I simply never ever write anything using Java… But sure, I don’t write “complex business logic” software either.
Hah, complex business logic or not, I think the choice of the technology should mainly depend on what one has/wants to reach.
Wouldn’t you feel uncomfortable sticking to your preferred environment instead of using a more appropriate one for your targets just because the latter is too “simple” or not enough “on the metal” for you?
Yes I would, but no matter what I would like to do, I would always find myself uneasy if the “right tool” for the project is deemed to be Java. No matter what the project is.
Ok, got it!
I’ve read on your site you work a lot with embedded systems. I would have liked that too, but my career took a much “higher level” direction (Java, C++ and the like). Maybe one day I’ll move to Sweden… 🙂
Java pays off quickly when your application logic goes complex.
I left C and C++ for Java years ago also for my hobbyist projects. I feel that Java requires lot less energy to produce working results.
With Java I found that it was easy to build on stuff other people already built. And it works in reality. Upgrading libraries and runtime environments has shown be pretty painless. Repeatedly. In this sense it looks like I’ve found a real value in what you dislike?
My very own smarthome control system, which is some kind of distributed psedudo realtime application, also runs on java (+linux). It interfaces devices through Dallas 1-wire bus, serial port devices and soon also USB I/O devices. Pretty much metal here. But yes, okay, it’s not embedded.
However, Android looks pretty embedded 🙂
Yes, I must agree that a lot of my feelings are just that, feelings and I’ve tried to express that I have this feeling about it and I’ve tried to reason back and forth with myself how it comes that I feel this way about it.
I honestly don’t see how java programs running in Android are much different than java programs running in any existing phone or embedded environment. I got a lot less interested in Android when I realized it’s extremely Java-focused.
I don’t magically get fond of things you can cram in an embedded device…