r/java • u/VaidasC • Feb 10 '15
Java Rant - what do you think?
Intro
Please be aware that this is the Rant with goal to express my internal feelings since I have been carrying this some time now and just need to release it and know no better way than Internet. Also maybe, as a secondary objective, get few comments.
Also the content may be abstract, without any specific evidence other than "anecdotal evidence" and personal experiences that may also be to abstract. I know I know, all with extroverted logic and rationality can't stand and understand this, but:
a. the goal is not to prove something or convince, but to express feelings;
b. I belong to that group who extroverts abstract things and conclusions rather than logic;
c. I am writing this without any planning and even without any reread/review - so basically just random thoughts on the spot, without any preparation.
So everything should be taken with grain of salt, as what I am writing may have different meaning than it reads (I know I know, but thats the way it is).
My theory
People who really like Java (platform) fit into one of following groups (just come up with those so its not final, but is really irellevant to my rant):
Are engineers/admins/devops who love solving problems all day long just for the sake of it. Will refer to them as engineers.
Do not really like it: Have never seen how nice things could be; Are here for the money; Are here because of being against something else; Are here because everything else is terrible too, there simply are no good things in software development.
Everyone who pretends to like Java (platform) I consider either engineer or just lying. Because there is nothing to like in Java (platform) as a programmer! Everyone who likes programming in any of those contexts: just loves writing code; admires learning/understanding techniques like OOP/Functional/architectural; admires simplicity/purity/ cleanliness; - should never become java programmers! Java is good for companies, bad for programmers.
Who I am anyways?
I am Java developer for about 4 years now, have been using .net before that. I'll be honest, I switched to Java for two reasons - local market demand (money) and I grass-is-greener since I was young and willing to find whats best for me. I studied java, learned a lot, started to be fascinated about all the complexities, loved that I become good at setting up and configuring things and so one. Only recently I had some thoughts, that maybe all this makes no since and as a programmer I would be much happier on other platform that would allow me to free my mind from useless trash and just write code and deliver projects.
Why Java is terrible?
In short, it's terrible plain and simple, everything is so confusing and overcomplicated and what's even worse - people take pride in it. OK, so let me give few more details.
Is terrible as a hobby/learning
From day zero, Java was simply terrible in aspect of user-friendliness. Well some like to say "looser-friendly", but this is touched by point bellow regarding being proud of complexity. From day one I had it required to learn in university it always seemed to bring technical issues. constant pain. For example, few years ago I started reading a book about EJB 3. OK everything seems fine I seem to understand everything, lets try to develop hello world. What would you expect, of course nothing works, even if you copied everything from book. So youl spend entire weekend dealing with all kinds of stuff, from server incompatibilities to jndi naming issues to all kinds of other magic issues that are nowhere mentioned in the same book. Its great for "engineers" but Its a waste of time for conceptual programmer. And this is just one example, how many weekends I spent doing basically nothing really useful. Java is a time wasting platform, it simply does not respect your time! Contrast that to .net - in one weekend coming from knowing zero and having book in my hands you could build something very useful, because platform tries to keep out of your way. I am not even mentioning others like Ruby and so on.
Terrible for grasping the big picture
I don't know if that's just me, but Java platform brings so much junk which is like a big cloud of irrelevant useless stuff over your head which is basically preventing you from wrapping your head around stuff that really matters. Be it big project and its technicalities, be it learning new stuff (its so easy to not pay attention to HTTP stuff when you reading Java web book, since you are spending your time configuring xml files, web servers...). Obsession with setting things up, customizing Constant project setups, everyone has their steps, everyone has their favorite frameworks, favorite build scripts. Once we had a cross-team scrum-play-planning event where we did estimations and other kinds of stuff. And .net guys were simply amazed why you need three days to setup web project. I mean it tells you something. This one might be a bit exaggerated, but then again, there is no standard way to setup java projects - http://www.daedtech.com/a-tale-of-two-web-stacks-java-vs-net
We're proud of being terrible!
I have been there! We love out complexity, the fact that so many things simply won't work first five times you try. That all Java EE is rather complex and hard to grasp for newcomers (mind you, not because of stuff being inherently hard, but rather just because there is no roadmap, everything is hidden all over the place like big puzzle). I believe that we like this since it adds to job security and we learn to lie to ourselves that this is important, large scale enterprise technology for real men, not some teenager toys! But it is totally useless if you think about it from practical point of view of programmer who wants to have good time writing code.
Solving something is useless
For some time now I feel that many tasks/problems that I face daily on Java platform simply brings nothing to the table for me as a programmer who would like to learn something every day. For example - we all love Spring, so doing something with it (setup some security, some embedded MQ, anything basically...) you waste a lot of time dealing with all kinds of obscurities, but what you get back? It rewards you with nothing basically - what you have learned? Basically that something can be done and then you might copy code snippets for later reuse. Thats it, no satisfaction, nothing!
Basically what I am trying to say is that a lot of frameworks/libraries are built with idea of doing stuff instead of giving you tools to understand and do stuff by yourself. I remember in school I liked math and hated many of other subjects simply because it allowed me to not read math book at all and just understand few key concepts and everything can be solved by your imagination. So basically I see the philosophy nowadays in Java world to go against one of principles from pragmatic programmer book that you must understand what you are doing. But in many of the libraries there is no such understanding as such - you may understand what you are doing at that moment, but overall libraries are designed so that it's impossible to truly understand them. Its more like "Hey we have bunch of xml to do this stuff". There is no long term value in learning how to do something since you'll forget and there is no building blocks how to do something a bit different yourself.
I'll try to illustrate how I basically feel working with many Java frameworks. Lets say I have have problem that requires developing algorithm. OK first day with just a pencil I created the algorithm. Now its time to do some coding. I find out that for such task I should probbably use new exciting framework "AlghorythmsOverengineered". So I started writing my first for-loop. This library offers one class - ForLoopSimpleAbstractGeneratorFactory. Since I need my loop to be backwards, I read tons of documentation and can't seem to find if that is possible, only at the end of the day after debugging source code of library I find that I can extend ForLoopSimpleAbstractGeneratorFactoryCreator to provide this behavior. So after almost two days of work, I need another loop that will take parameters from the first one. I did some heavy reading and find out that I will need to implement another class and override two methods, since one allows passing of outer loops iterator, and another the "reduction" value. However I need both of those! Framework simply does not allow me to have it, so I rewrite abstract class from framework, add some dirty hacks and make my class stateful so I can now have those two parameters. Fast forward and after whole week of "coding" I now have working code. However I need to configure it into my container. So after another few days of useles xml copying-and-pasting-and-modification until something seems to start working I get my configuration running!
Cannot be good developer
Now personal again. What it means to be good Java developer. I personally don't know and objectively would think that to be one you almost have to be a genius of some sorts. In practice it has to do a lot with confidence, basically you have to feel like "senior developer" and pretend to be one, so you are one from that time. However since my character is inherently questioning everything and my competence as well, I just feel that its impossible to be "senior java developer" by any objective measure. I rarely seen senior Java developers who would be experts in anything, because simply there are so many useless things and so many useless tasks in daily life that its simply impossible to know something very well.
Possibilities - so what?
As a counter argument to many of my thoughts, there is believe that Java is so diverse and there are so many good stuff and you can just ignore the rest. However that is somewhat irrelevant on most of the day-to-day jobs, since the 90% of Java usage is somewhat like I described. And that amazing 10% is still miles away from useles-crap-free-mind of .net or Ruby developers.
What's next?
I don't know, back to Java day-to-day tasks. Since switching to something like .NET might be costly (money again). For some time I hoped to jump into something new and exciting, but just don't see something like that right now. Golang - just too low level, now that I grasped some functional principles. Scala - just too dirty language and has majority of Java's pain points above. F# would seem as a good candidate - clean language, IDE that shields me from useless crap, however there are no demand for it right now.
6
u/pron98 Feb 10 '15 edited Feb 10 '15
Well, I've been programming heavily in Java for over ten years now, and before that, a similar number of years in C and C++, plus a lot of Matlab, a little bit of C# and Groovy, some Scala, Scheme and even some Ada. Recently, I've been writing quite a bit in Clojure, too. My Java projects have included soft and hard real time systems (even safety-critical), large HPC-style numeric simulation stuff, in-memory distributed databases, some mobile and more (though almost no web and no CRUD). I have never encountered the problems you complain of, certainly no more (and usually less) than in other platforms. I think that what you're experiencing is simply a symptom of the organization where you work; mine has been the complete opposite.
Here's why I like Java (the language) and love the JVM:
The language is minimal, easy to grasp, hard to distort, and isn't quick to adopt every fashion. This is bad for short-term projects, but a godsend for large, multi-MLOC systems worked on by large teams of developers and require maintenance for about a decade. Everybody's code looks similar enough for other developers to learn quickly and adapt quickly without feeling the need to re-style everything (of course, that happens, too, but far less than in more feature-rich languages). Also, the language makes you focus more on the domain than on various nifty tricks you can do with your code. True, young developers may not like that, but they learn to understand that's what's best when they grow up.
The platform gives you -- by far -- the most bang for the buck in terms of performance than any other programming platform out there, and, best of all -- this advantage scales! A 10KLOC program might be written in C/C++ to be faster in only a little more time than in Java, but a 5MLOC piece of software at comparable performance is almost impossible to write in any other language at acceptable costs for most organizations.
The platform gives you the best insights into its operation at runtime -- with little or no performance impact -- and incredible flexibility to change and re-change production code as it runs (by inserting Byteman/BTrace probes, for example, or supporting hot code swapping). The Java monitoring tools are unmatched by anything out there (even Erlang's) and I haven't seen any profiler as powerful as JFR anywhere.
While deployment is not as easy as shipping a single binary, it is far better than most other non-native languages (and supports hot code swapping).
A polyglot environment with easy interoperation among very different languages.
You speak of programmers vs. companies; I think the distinction is inexperienced vs. experienced developers. Inexperienced developers think that the code they produce is the goal. Experienced developers know that working, efficient, running programs are the goal, and getting there requires more than pretty code; in fact, pretty code may hurt your prospects. I will repeat something I've said before: some people say with pride that their language of choice is a language for smart developers; Java is a language for wise ones.
Nevertheless, it is true that Java (the language) was not designed for quick, short-term projects. Thankfully, you have other JVM languages to choose from. My favorite is Clojure, and I'm considering Kotlin as a replacement for some of the Java code.
2
u/VaidasC Feb 10 '15
Well, judging by your JVM better points and whole post, I would put you into engineer category - pragmatist who loves solve real problems, so no surprise that you like Java platform. As a contrast, I would describe myself more like someone who cares about ideas, has constant philosophical dilemmas about concepts, can think for days about inconsistencies and often miss real-life simple details as less relevant. So basically this represents two different worlds and hence my frustration with imperfect, burdensome and irrelevant-detail-oriented platform. But then again, many people do hate Java (I wouldn't say I do) platform and so it makes me feel that I am not someone in very small minority, but there still is something fundamentally wrong in how platform trends are going.
When I talked about companies vs programmers, what I meant was that, Java is probably the best tool to develop commercial software, build business around - stable, many choices from servers, libraries, licenses to fit any business needs. However as a programmer who likes to program and does not plan building business on some software, you could care less about all of that basically and follow technology that gives you less pain and more joy. What I am talking is basically from the point of doing job that fulfills you and my argument was that I see no way that if you're in programming because of programming itself (e.g. you love to write code, solve algorithms...), Java is not the place to go probably.
2
u/pron98 Feb 10 '15 edited Feb 11 '15
there still is something fundamentally wrong in how platform trends are going.
I think you are sorely mistaken about this. There is tremendous, ground-breaking innovation on the JVM: G1 and JFR are recent changes; modules (with JIT caching) and fine-grained JIT controls are forthcoming in Java 9, with immutable value types to follow; next-gen VMs (Graal) are already in the works. OpenJDK is the second-largest open source project in the world (after the Linux kernel).
As usual for Java and the JVM, most of these enhancements are hidden from your code. That's intentional. The idea behind Java was to expose a very simple -- almost primitive language -- that's backed by a state-of-the-art VM behind the scenes.
I see no way that if you're in programming because of programming itself (e.g. you love to write code, solve algorithms...), Java is not the place to go probably.
Well, this is a very general statement, that might be true in some cases. For example, I do advanced algorithms. I read lots and lots of academic papers, and then spend months trying to come up with a novel concurrent, distributed algorithm. Like I said, I have never done web or CRUD stuff. I believe that most of the pleasures in CS come from algorithms and data structures. Once I come up with the algorithm -- after months of work -- I could care less about what language I write it in (well, I care, but due to other concerns). Also, most of my work revolves around concurrency, and no programming environment in the world offers a better platform for concurrent programming than the JVM (much of it due to its superior GCs). So, for concurrency, Java is very much the place to go.
As a team lead, my main concern was the general architecture of the project. I was concerned with the elegance of the general design -- not with that of a single function -- and often then more "primitive" the language, the better the various modules fit together to form a consistent whole.
In short, I think your sentiment is not due to your intrinsic character, but mostly a result of still being in the stage where the function or compilation unit is where you find elegance. Algorithms are a mathematical construct that are elegant no matter how they're translated to code, and as your career progresses and you're responsible for ever-larger pieces of software, you'll find that the very things that can make a function elegant, might make a project very much the opposite of elegant. However, at the level of the single function/class/module, there are indeed nicer languages than Java. I very much doubt you'll find better platforms than the JVM, though.
The JVM is the Ferrari of runtime environments. It might not be the easiest to handle (though It's quite easy) but when you want the most of your machine combined with the most insight you can get into your running program (as well as the ability to modify it) -- it's state-of-the-art. Some people prefer driving Toyota; I, too, sometimes want a little less mental maintenance. But when you need the best of the best, and you have a lot riding on your success, don't settle for anything less than the Ferrari.
1
u/buttermilk_rusk Apr 30 '15
Thank you, great post! I'm about 8 years into Java development as a career, also with Matlab and C in my background, no web stuff. Great to read your insights like this.
3
u/JavaDroid Feb 10 '15 edited Feb 10 '15
http://www.daedtech.com/a-tale-of-two-web-stacks-java-vs-net
Here's what I did:
Installed ubuntu
installed oracle java 7
installed postgres
downloaded wildfly, installed and added service
downloaded postgres jdbc, added to wildfly.
started all services. no configuration and I was able to get to it locally.
downloaded intellij
File -> new project
selected Java Enterprise
checked web application
done. Built and deployed.
It is curious how your comparison guy gleefully forgot to install the Microsoft .net web stack and visual studio in his Microsoft steps. Also curious that he didn't actually build anything, he just made a new project.
I guess I can't fault him for his blindness and stupidity.
Normally I'd use gradle, but since your dude was allowed to use woefully underpowered build tools, I took that route for the sake of fairness.
Edit: postgres was unnecessary steps, but you need a database, so I included for posterity. Installing Ubuntu also unnecessary, but I like to keep my Dev environments and my desktop somewhat sandboxed..
0
u/VaidasC Feb 10 '15
Well that was a bit of an exaggerated, but keep in mind there is no standard way to create new Java project, so there are many ways. For example:
8) File -> new project 8) selected Java Enterprise 9) checked web application
I am afraid this is not really real-life project creation (maven, gradle) and last time I checked when creating project from maven-archetypes, I needed to do a lot of manual stuff (create directories, create/edit files...) or delete a lot of stuff depending on archetype.
2
u/JavaDroid Feb 11 '15 edited Feb 11 '15
Go use an advanced build tool for C# instead of comparing Javas advanced build tools with visual studio standard projects.
IntelliJ and eclipse have standard layouts that are built for you as well. It isn't fair or appropriate to compare an IDEs project structure with build tools.
Also, if you become familiar with said build tools, you quickly realize that
the standard can basically be whatever you want, because that is an option
there ARE standards for project layouts, you just have failed to learn them.
1
u/VaidasC Feb 11 '15 edited Feb 11 '15
To me all of this sounds like trying to formally prove that something many people complain is not true formally, even though experience tells otherwise.
As far as I know (maybe wrong), there is MSBuild in this default .net project where you could do advanced stuff and that will be run by Visual Studio's f5.
But the bottom line is - in my real-life experience I have probably never seen Java project that would be set-up quickly without some issues. However almost all projects I had with .net, had no such concept as setting-up project and that was more than 4 years ago, now I hear things are even nicer.
1
u/JavaDroid Feb 12 '15
Then use the IDE standard tools for your project. The fact is that you are wrong.
Maven / gradle / ant / etc do take a little more to get started (hardly), but they also resolve and manage dependencies as well as your build. The basic project in MS doesn't do this.
You are wrong and way over exaggerating everything. Even as a beginner, I've never encountered a number of issues you claim.
1
u/VaidasC Feb 12 '15
Well they have MsBuild (build tool) + Nuget (dependency management), so not sure what you are talking about.
1
Feb 14 '15
Msbuild doesn't manage your dependencies, Visual Studio does (via nuget). If you need to produce your build without VS involved - eg on a continuous integration server - you will have to deal with additional complexity. Furthermore, even if you are using VS, it won't publish packages for you, just retrieve them.
1
u/pron98 Feb 10 '15
Download and install the JDK
Download and install NetBeans (EE option -- already bundled with Tomcat)
File -> New Project -> New Java Web Application
F6
1
u/VaidasC Feb 12 '15 edited Feb 12 '15
OK, so to show my view from other angle lets take random platform comparison from few years ago http://www.adam-bien.com/roller/abien/entry/java_ee_or_net_an
Let me analyse Java pluses from my rant's point of view
Agree
p2. Only somewhat agree - MSBuild + NUget fits most of use-cases, but I agree that maven/gradle is potentially more powerful.
p10. Best practices.
p12. Operating System - would prefer working on Mac, although I heard its coming in future.
Arguable or Irrelevant
p1. ORM. Entity framework + Linq is very nice.
p4. C# is top tier too.
p11. Well I had so much "pleasure" integrating all kinds of frameworks in Java.
p13. Open source - well now .net is OS, but again not sure if this is that important as everyone seems to make it to be.
Relevant if you are owner ("your app")
In other words, I would care for those things if I was manager or planning startup, but irrelevant if planning to be an employee:
p5. Free IDE - you won't have to buy IDE yourself anyways and as of now community edition is OK for 5 devs commercial usage.
p6. Integration with all kinds of third party stuff - usually very ugly and frustrating in java. But in .net, where is no integration options - you simply won't have to do ugly, non-rewarding work! Yay!
p7. Frameworks/Libraries - .NET provides core ones, what is missing is 3rd party specific use-case ones.
p8. Vendor Neutrality. Also keep in mind that I rarely see truly vendor neutral enterprise application - usually configuration files for weblogic/websphere all over the place.
p9. IMHO backyards compatibility is important for owners or developers who hate changes. Otherwise, for me wilingless to break things from time to time is an advantage - less garbage.
.NET
While most of .NET advantages scream Productivity, Programmer-satisfaction, No-time-wasting evaluating/choosing from equally bad frameworks.
Disagreement
I tend to believe that disagreement with my rant's point of view often comes from either valuing or discarding pluses from "Relevant if you are owner" part.
1
u/killinghurts Feb 11 '15
Is terrible as a hobby/learning
Not really. The process you followed seemed to be overkill for a hello world app, it sounds more like you were attempting to learn EJB, which, agreed is a complicated specification not designed for hobbyists.
Terrible for grasping the big picture
Setting up a new project shouldn't be a difficult process, nor should it be a precursor to "not grasping the big picture". Gradle is good at this, I would also recommend Maven archetypes for speedy project setup.
This library offers one class - ForLoopSimpleAbstractGeneratorFactory. Since I need my >loop to be backwards, I read tons of documentation and can't seem to find if that is >possible, only at the end of the day after debugging source code of library I find that I can >extend ForLoopSimpleAbstractGeneratorFactoryCreator to provide this behavior
Perfect Planning Prevents Piss Poor Performance. If you had have understood your requirements first you wouldn't have selected the "AlghorythmsOverengineered" framework in the first place.
I rarely seen senior Java developers who would be experts in anything, because simply there are so many useless >things and so many useless tasks in daily life that its simply impossible to know something very well.
All I say that if you are spending your time performing useless tasks, you're definitely doing something wrong.
0
u/VaidasC Feb 11 '15
Not really. The process you followed seemed to be overkill for a hello world app, it sounds more like you were attempting to learn EJB, which, agreed is a complicated specification not designed for hobbyists.
I wanted to learn EJB, which conceptually was not hard at all! (I want to emphasize this so much) What was hard - was irrelevant obstacles that thought me nothing conceptually - like jndi issues, server incompatibilities and so on. So I spent one day reading about EJB - good time investment and other 1-2 days dealing with irrelevant obstacles (waste of time).
That is my problem, not that EJB is hard specification.
Perfect Planning Prevents Piss Poor Performance. If you had have understood your requirements first you wouldn't have selected the "AlghorythmsOverengineered" framework in the first place.
But if that's the only thing in town or alternatives do not seem to be better? This example is taken directly from configuring Spring security to do advanced tasks, but put in different context.
1
u/killinghurts Feb 12 '15
What was hard - was irrelevant obstacles that thought me nothing conceptually - like jndi issues, server incompatibilities and so on.
I'm not going to defend EJB, it can be a nightmare and should be easier, but I will say there are much more elegant solutions out there that "just work". Java isn't perfect, but no language is, but it does sound to me like you are having unusual issues (perhaps your workplace polices restrict you?).
But if that's the only thing in town or alternatives do not seem to be better?
Then you roll your own. It's a fine line between extending an existing framework to meet your needs and developing your own. You have to weigh up the two - how much time it takes to extend and (constantly) learn, maintain libs/upgrades of an existing framework vs developing your own.
2
u/JDBProof Feb 11 '15
The comments lighten me up much more than the post itself, it's so abstract and doesn't really expicitly state anything.
9
u/the_hoser Feb 10 '15 edited Feb 10 '15
Here's what I think: the company that you work for stinks. Get another job.
I couldn't read all of that. Your tautologies just hurt too much. You've been using Java for 4 years and you've got it all figured out. Right.
JavaEE isn't Java. Say it again, please, out loud: "JavaEE isn't Java." You don't have to use JavaEE. JavaEE is a solution looking for a problem. It's getting better than it used to be, but it was never necessary.
I've been using Java for 13 years, for personal and professional purposes. I've never once needed JavaEE. I've found pieces of it useful, but I've never had to go full-stack.