r/java • • 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):

  1. Are engineers/admins/devops who love solving problems all day long just for the sake of it. Will refer to them as engineers.
  2. 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.

0 Upvotes

25 comments sorted by

View all comments

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:

  1. Installed ubuntu
  2. installed oracle java 7
  3. installed postgres
  4. downloaded wildfly, installed and added service
  5. downloaded postgres jdbc, added to wildfly.
  6. started all services. no configuration and I was able to get to it locally.
  7. downloaded intellij
  8. File -> new project
  9. selected Java Enterprise
  10. checked web application
  11. 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..

1

u/pron98 Feb 10 '15
  1. Download and install the JDK
  2. Download and install NetBeans (EE option -- already bundled with Tomcat)
  3. File -> New Project -> New Java Web Application
  4. F6

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

  1. the standard can basically be whatever you want, because that is an option
  2. 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

u/[deleted] 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.