r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

77

u/sacundim Feb 22 '15

What's the deal with these linkbait articles that just lift a question/answer from somewhere else? I've seen them in Ars Technica, now it's in Forbes...

20

u/perestroika12 Feb 22 '15

I think someone figured out a % of their viewer base are programmers, probably a tactic to drive traffic to the site.

3

u/[deleted] Feb 22 '15

Or the intersection of "occupations most likely browsing the internet" and "occupations with middle to upper class socioeconomic status" is a viable demographic to target.

→ More replies (1)

4

u/bluecoffee Feb 22 '15

Same reason journalists lift wholesale from press releases. They've got a quota to fill and it gets an article out the door in the least amount of time.

1

u/Eirenarch Feb 22 '15

Ars Technica ones are definitely not clickbait. I mean they don't have the absurd title this one has.

219

u/aldo_reset Feb 22 '15 edited Feb 22 '15

Why do many software engineers not like Java?

They don't.

Seriously, I know it might be hard to believe, especially if you spend time reading reddit, HN or if you are subscribed to a few mailing-lists on the subject (which means you are part of a very tiny minority), but the bottom line is that the majority of Java developers is quite happy with Java.

If you are one of these bleeding edge developers who keep their knowledge current, are aware of Scala, Kotlin, Ceylon, Clojure or maybe even ML or Haskell, you are convinced that Java is an abomination and that certainly, all its users must absolutely hate it. And you are dead, dead wrong about that.

Before Java, we had C++, and if in the 1990-1995 period, you had interviewed C++ developers, you would probably have found out that a huge proportion of C++ developers absolutely hated programming in this language. Which set the stage for Java to take over in 1995.

I'm not seeing this today. There are no rabid mobs of developers with pitchforks massing at the gates and asking for a revolution. Java is respected for its productivity, its readability and its unbeatable fast path to getting things done in a way that's scalable and maintainable.

Which is why that it's not going to be replaced any time soon. Not by Scala, not by Kotlin, not by Ceylon. In a lustrum, maybe. But not in the near future.

Java is fine, it's liked, it's respected (for good and bad reasons) and it's going to be around for a very, very long time.

40

u/llogiq Feb 22 '15

I am one of those bleeding edge developers you mention, I know Lisp, ML, Haskell and am currently looking into Rust. And I'm also a Java developer, and quite happy with Java.

Java sucks at some points, yes, but not as hard as many think. For a lot of problems, it's actually quite capable, and the specific pain points some folks never tire to mention either can be worked around with little effort or don't impair productivity as much as they think anyway. Also, frankly, the tooling just rocks.

18

u/f2u Feb 22 '15

I am one of those bleeding edge developers you mention, I know Lisp, ML, Haskell

  • Lisp: 1960

  • ML: 1979

  • Caml: 1987

  • Haskell: 1990

It's funny that those are considered bleeding edge. And I picked the year of the first formal publication. In reality, even Haskell is several years older than the mature (read: old-fashioned) Java.

6

u/BobFloss Feb 22 '15

I guess it's more that those languages have seen increased popularity (and changes, probably) recently.

→ More replies (6)

12

u/yogthos Feb 22 '15

As one of those bleeding edge developers who developed Java professionally for a decade before moving to Clojure, I would not go back to working with Java.

My team saw a huge leap in productivity compared to the similar scope projects we've done in Java. The language does play a big role in this. Being able to write code close to the problem domain makes the code base much smaller and easier to maintain.

Having drastically less code has impact on things like refactoring. When it takes you a 100 lines to solve a problem you're not all that attached to the code. When it takes you a 1000 then you're much less likely to want to revisit it.

Being able to safely reason about parts of application in is a huge benefit when you're working on a large project with a team. I know that I can work on my piece and I'm guaranteed that it doesn't have any shared state with another piece somebody else is working on.

When I come back to some code 6 months down the road I know that the changes I make are guaranteed to be local. I don't have to remember how it interacts with the rest of the application, where the data is coming from and where it's going.

I also agree that tooling is important. I find REPL to be an indispensable tool. With it I can solve problems interactively and see exactly what the code is doing. Having it integrated into the workflow makes development a far more pleasant experience.

Aside from that, I find you have pretty much the same tooling you have for Java. You've got Leiningen or Maven for doing builds, you can use the same profilers, build servers, and deployment targets.

You can also use the same IDEs such as Eclipse or IntelliJ. The refactoring support might not be as powerful, but you also tend to have orders of magnitude less code. I'd much rather have less code to work with than fancy tools to help me manage giant heaps of it.

2

u/llogiq Feb 22 '15

I usually whip up a quick unit test + debugger if I need to test something, but I also sometimes just start a beanshell.

→ More replies (5)

0

u/[deleted] Feb 22 '15

[deleted]

→ More replies (20)

1

u/loup-vaillant Feb 22 '15

How much shorter do you think your programs would be if you were allowed to write them in either Lisp, ML, or Haskell?

My personal wild guess is somewhere between 3 and a full order of magnitude. Java may be fine, but whenever I see a lost opportunity for brevity and simplicity, the gap between what I have and what I know kills me. The only way I'm still happy at my current, C++/Qt day job, is because I'm currently learning OOP based GUI programming, and don't know any other way yet. I kinda fear the day when I will.

2

u/llogiq Feb 22 '15

Well, part of my programs could be considerably shorter. Of those, I generate a good percentage (e.g. Lombok). But I do a lot of number crunching, and the arithmetic looks the same whether I write it in Java or Haskell.

→ More replies (11)

57

u/[deleted] Feb 22 '15

I've always maintained that HN and Reddit over represents the startup mentality in almost everything. In reality a ton of Java is written (if you asked around here everyone would think that Java is legacy only), and it seems to be working just fine.

Eventually it'll go, of course. It'd be foolisg to say that Java is it, but there's not a ton of evidence that the time is now.

24

u/continuational Feb 22 '15

It over represents opinions from people who care enough about their profession to browse /r/programming. These are the same people who are dissatisfied with working in poor languages. People who don't care would rather stay with whatever they already know.

13

u/armornick Feb 22 '15

People who don't care would rather stay with whatever they already know.

Or stay with what you're being paid to use. Because I like other languages too, but I only get paid to use Java.

→ More replies (5)

3

u/ameoba Feb 23 '15

Reddit overemphasizes the opinions of young, inexperienced people.

→ More replies (4)

2

u/argv_minus_one Feb 22 '15

There is no such thing as "it". As long as computer science exists, new languages will keep getting invented.

→ More replies (8)

14

u/vincentk Feb 22 '15

I'm one of those bleeding edge developers, and believe it or not, I'm still quite happy with java.

2

u/[deleted] Feb 22 '15

Same here, latest fun language has been purescript.

4

u/htuhola Feb 22 '15

I hoped to see a large-scale interview when I saw the title. Without that you can't really say whether java developers are happy with their language or not.

Looking on Reddit I see people advocating about all kinds of languages. You'll find APL, C, C++, PHP, Fortran lovers. Wouldn't be surprised if somebody says he loves cobol or basic.

You probably can't know if people hated C++ in the 1990-1995 period, similar to how you can't know if people hate java now. We don't have the data to drive those conclusion. Besides you've pretty much proved this far that such study couldn't lead us to other conclusions. Popularity of a programming language isn't rooted into it's quality.

I'm surprised to hear that you respect java for it's productivity and readability, though. But maybe you're doing so simple things that it works out.

4

u/joequin Feb 22 '15

I think it's extremely readable, because unlike functional languages and newer languages it doesn't encourage the cleverness that often impedes code readability.

3

u/kcuf Feb 22 '15

Layering several abstractions, spread across various files/packages, just to achieve future maintainability impairs readability. Shared mutable state impairs understanding, and thus readability.

→ More replies (10)

2

u/htuhola Feb 22 '15 edited Feb 22 '15

I remember having heard that kind of argument. Somebody said it about Visual Basic or QBasic. Again, given certain constraints, it's true.

→ More replies (3)

6

u/drysart Feb 22 '15

but the bottom line is that the majority of Java developers is quite happy with Java

I have a feeling that's because developers that know there are better environments out there get jobs where they don't have to write Java.

4

u/yogthos Feb 22 '15 edited Feb 22 '15

True, majority of developers see absolutely nothing wrong with Java. It's probably the only language they've used professionally since they got churned out of school and never had a reason to learn anything else during their careers.

Majority of people don't even care about programming all that much in the first place. It's a job and it pays their bills. They punch in, write whatever it is they're told to write and go home to do whatever it is they're actually interested in.

Most of the people who have actual interest in programming learn things on their own time. They're the minority and they're the ones who end up getting jobs in startups and forward thinking companies.

People seem to have a lot of hate for anybody who works with a niche language. You hear terms like "hipsters", or "rock stars". Seems to me a lot of the derision and the hate comes from knowing that these people actually enjoy doing their jobs.

→ More replies (3)

1

u/CyruzDraxs Feb 22 '15

I work at a Java-heavy company employing about 70 devs, 60+ of which despise Java. There's only a handful of them that are actually willing to even touch the Java bits.

There definitely is a lot of people that hate Java. At this point, there are some much nicer alternatives (Rust, Go, D, etc.). None have existed long enough to reach the maturity required to supplant Java yet, but I definitely think it will happen within the next 5-10 years.

7

u/[deleted] Feb 22 '15

I think most of the hate related to Java comes from bad frameworks and tools and not from the JVM or the language itself. Most companies hate rewrites or changing tools so they continue using the same bad frameworks for years and years even though they become less and less productive compared to the competition.

6

u/[deleted] Feb 22 '15 edited Feb 22 '15

Java backward compatibility may have ended up to be more of a curse than an asset. The number of companies running Spring 2 is amazing.

→ More replies (1)

18

u/bcash Feb 22 '15

There definitely is a lot of people that hate Java. At this point, there are some much nicer alternatives (Rust, Go, D, etc.). None have existed long enough to reach the maturity required to supplant Java yet, but I definitely think it will happen within the next 5-10 years.

Not a chance.

The space that Java occupies is, if anything, thinning out rather than gaining competitors. Ten years ago it was the arrival of higher-level scripting languages, more recently there's been the flood of C++-replacements (of which Rust, Go, and D are all members).

The middle-ground, the managed runtime level, is lacking in competition. Or rather the competition that exists is complementary (e.g. other JVM languages).

3

u/rcode Feb 22 '15

C++-replacements (of which Rust, Go, and D are all members).

Except that Go isn't (and never was) a C++ replacement. Even the Go authors decided it was a mistake to have called it a "systems language" when it came out.

8

u/Dworgi Feb 22 '15

C# says hi.

And considering it's gone open source, that's a pretty big competitor.

8

u/[deleted] Feb 22 '15

My BluRay player, set-top box, smart cards, Android tablet, bank, etc. tell me Java is here to stay.

21

u/weeezes Feb 22 '15

But a dude on the internet says it's not, so I just have to go with that.

20

u/[deleted] Feb 22 '15

And considering it's gone open source, that's a pretty big competitor.

Unless Linux becomes a first class citizen there is no real competition.

→ More replies (6)
→ More replies (8)
→ More replies (3)

1

u/s73v3r Feb 22 '15

Stupid question, but if they hate Java, why are they working at a Java heavy company?

→ More replies (1)

1

u/[deleted] Feb 22 '15

I bet it's real fun working there

→ More replies (1)

1

u/Alborak Feb 22 '15

I'm currently working a project done in C++ that really should have been Java. It would have needed JNI to interface with one 3rd party component, but otherwise we lose many hours every week due to a combination of C++ complexity and developer inexperience with it :(

1

u/mrbonner Feb 22 '15

I found that it is easier to read and understand the intentions of a piece of Java code comparing to other languages I have worked with, for example JS, Python, PHP, Perl.

1

u/s73v3r Feb 22 '15

I think there's a large difference between Java the language, and the culture of a lot of Java shops. Java the language can be fine. It has great tooling, a nice ecosystem of open source libraries to do whatever you want, and it's easy to find people who know it.

The problem comes with the culture that a lot of Java shops have. One could argue that it's no different than the culture of regular big business shops, but Java just seems to exacerbate it. Things like over engineering everything, FactoryFactories, and that general feeling that you're just a cog in a huge machine, rather than someone who's actually having an impact.

-3

u/[deleted] Feb 22 '15

the majority of Java developers is quite happy with Java.

The majority of developers are idiots. There are brilliant developers, and there are boneheads. This is my experience of 30+ years writing software for money. Given a million dollar budget I would much prefer 4 elite developers at $250k each to 20 shitty J-heads at $50k each. The 4 elite ones will wipe the floor with the 20 "average" developers.

As a hiring manager, a sure clue that someone was an idiot was if they represented themselves as a "java [architect|developer|engineer]" rather than a software person with multiple languages under their belt.

10

u/bcash Feb 22 '15

The 4 elite ones will wipe the floor with the 20 "average" developers.

That's always true, notwithstanding the standard disclaimers on the difficulties of identifying the elite, regardless of technologies.

→ More replies (1)

7

u/[deleted] Feb 22 '15

I think it is easy to misconstrue your statement to conclude that only idiots are happy with java but you didn't say that. Right tool for the job still applies and I agree with you that most developers I have worked with are mediocre at best, they actually will hate any majority language because they are lazy as well frequently.

1

u/makis Feb 22 '15

Before Java, we had C++, and if in the 1990-1995 period, you had interviewed C++ developers, you would probably have found out that a huge proportion of C++ developers absolutely hated programming in this language. Which set the stage for Java to take over in 1995.

that's not entirely true. I mean, this is your opinion, but C++ is still more used than Java.
How's that possible if what you say was true?

Truth is back in the day there were not enough alternatives, and many were forced to use C++, even if they were not able to write proper c++ or understand it.

Truth is, Java was sold as an easier C++, with easy multi threading, (which is not) and people though "now I can finally multi thread and speed up things", and created bloated monsters where every connection opened up a new thread, every computation unit had it's own tread, killing performances for everybody for a long time.
And making CPU and RAM producers happy as never before.

Truth is at my university we studied ML (standard ML) and C++ (besides pascal, prolog and other minor languages), one for learning Object Oriented programming and performance sensitive code, the other for FP and get used to totally different paradigms.

Few years after, some new shiny Sun workstation appeared in the labs, and suddenly everybody was ditching ML to teach Java, and now students were being taught two competing languages, that were very similar, except one of them had horrible performances, libraries, tools, etc. etc. and completely ruined the mindset of a generation of coders.

Yep, I'm talking about money invested to make Java a successful language, while it had no real merit to become one.
Just like Go now, but worse, at least you can learn everything about Go in one week and you'll never ever write a Factory Class with it!
At least Go can be quite useful.

Twenty years later they now have a pretty good VM (you don't say, in 20 years…), but Java the language have set back CS evolution for almost a decade and we are just now realising what big mistake we made, permitting to the "industry" to infiltrate their men in every committee to lobby all over the place, to block C++ standard evolution in primis and praise Java as the only solution that would have freed us from the tyranny of C++.

→ More replies (110)

140

u/karlhungus Feb 22 '15

I have no love for java.

While it performs pretty well nowadays, it still isn’t competitive with C or C++ and, with a little love, Haskell and OCaml can or will eclipse it in that domain.

I didn't think this was true, i thought it was somewhat close to C (excluding startup).

For real-world production servers, it tends to require a fair amount of JVM tuning.

This is really seems like reaching for something to be a problem that isn't.

because it objectively sucks.

If people can't even define OO, it can't objectively suck. If you were making a pun i forgive you.

culture is one of mediocrity and bad taste, with MetaModelVibratorVisitorFactory

These kinds of strawmen make me feel like "I don't have to read another word this person writes."

61

u/[deleted] Feb 22 '15

These kinds of strawmen make me feel like "I don't have to read another word this person writes."

I agree to an extent - but I do think the Java community overembraces creation of single-purpose objects over just calling functions.

See this example from the Apache HTTP client docs:

HttpPost httpPost = new HttpPost("http://targethost/login");
List <NameValuePair> nvps = new ArrayList <NameValuePair>();
nvps.add(new BasicNameValuePair("username", "vip"));
nvps.add(new BasicNameValuePair("password", "secret"));
httpPost.setEntity(new UrlEncodedFormEntity(nvps));
CloseableHttpResponse response2 = httpclient.execute(httpPost);

First off, it's great that they used an ArrayList<> instead of a NameValueCollection() or something, but wouldn't the code be better like:

HttpPost httpPost = httpclient.post("http://targethost/login");
httpPost.addParam("username", "vip");
httpPost.addParam("password", "secret");
HttpResponse response = httpPost.execute();

That's 33% less written code, with no real minuses other than implementation details are hidden.

It seems very endemic to Java libraries that the API is written to require the full power of the library, rather than being written to be simple to use. In this case, it's written to allow a lot of flexibility in how forms are encoded, in how name-value pairs are constructed, etc., at the cost of needing to build (unnecessary) HttpPost, NameValuePair and UrlEncodedFormEntity objects.

See also: Swing, Apache Lucene, Struts, many other popular frameworks.

28

u/pfitzsimmons Feb 22 '15 edited Feb 22 '15

Some newer libraries are getting better at this. For example, now you can use Unirest for http in java, which is even simpler than your example:

Unirest.post("http://httpbin.org/post")
  .queryString("name", "Mark")
  .field("last", "Polo")
  .asJson()

Also, the new Java RESTful web services API is actually pretty good. I actually like its way of defining endpoints better than how python frameworks like django and flask do it.

But yeah, it really does baffle me how so many java libraries seem to go out of their way to make you use five lines instead of one. Why not add a bunch of helper methods for the most common use-cases? Time adds up when everything you do is twice as verbose as it needs to be.

18

u/bcash Feb 22 '15

There are, as other comments have mentioned "better" HTTP libraries that present a much higher-level API. But Apache's HTTP Client has the specific aim of implementing HTTP as it's defined, and designed it's class-structure with that as a goal, allowing the various options to be substituted.

So, of course, form submission will be the most verbose example, as URL-encoding pairs of values is a convention, the mechanics of POST go far beyond that one case (yes, that one case is the most common).

There's nothing wrong with this approach. Indeed it's very valuable for non-trivial circumstances. But if you don't need it, there are other libraries available.

→ More replies (3)

15

u/LOOKITSADAM Feb 22 '15

It seems very endemic to Java libraries that the API is written to require the full power of the library, rather than being written to be simple to use.

I seem to be in the minority, but I absolutely love this aspect of big java libraries. There's always something to be done about just about everything. If I want to change how expressions are parsed in a .jsp document, I can.

11

u/bcash Feb 22 '15

Exactly. Most language comparisons around here come down to "here's an example I don't like, therefore it's wrong" often accompanied by a citation to some completely different tool.

There are trade-offs. If you need to control the corner cases of HTTP than Apache's HTTP client is a good choice; if you're building a REST API client there are REST clients which do a much better job. One is not right and one is not wrong, they're just serving different purposes.

7

u/gingenhagen Feb 22 '15

That point of Apache HTTP is to create one layer of abstraction above the java.net package. Now, for your application, you can easily create another layer of abstraction and make it look like your sample code. But isn't it so much nicer getting to build using the org.apache.http package instead of having to use java.net?

3

u/tieTYT Feb 22 '15

FWIW I program in java all day and IMHO that HTTP Client has a really inconvenient API. I completely agree with you.

Us Java devs are in a tough spot. Even if it's the best fit, using a "function" in java (a static method) could really screw over the next guy who wants to test the code because it's extremely difficult to replace static things with test doubles.

4

u/GUIpsp Feb 22 '15

Apache libs tend to get stuck in the past.

6

u/notfancy Feb 22 '15

I'd say they aim at being very general in their domain, so they tend to display both a high level of abstraction and a low-level API. They can be used anywhere but you have to pay a high upfront cost for that.

→ More replies (1)

2

u/strattonbrazil Feb 22 '15

They definitely exist, but it's hardly surprising given the size of the community. There are many libraries (especially newer ones) that have very terse APIs.

2

u/mirvnillith Feb 22 '15

That's 33% less written code

I agree, and perhaps that option should be in there (or just wrap it to suit yourself), but the first variant is more flexible and does not force a sequential approach (e.g. you can collect the parameters from whereever, without having to yet know the URL).

I personally highly favor APIs/utilities that give me options and that mostly means the kind of "separation of concerns" that in "to the point" code like yours does mean more coding.

2

u/karlhungus Feb 22 '15

The longer I go not using java the more I forget, and I don't think i was ever familiar with the HttpPost library enough to defend their choices. On the face of it though I totally agree with your point.

I did use Lucene, and found it pretty reasonable, maybe I've just blocked it out though. Struts all i can remember of it is a seething hatred.

If the author had stated things the way you've done, I'd have an easier time with the article. In stead it comes off as puerile, hell make it a joke and use https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition.

1

u/CyclonusRIP Feb 22 '15

httpPost.setDoc(xmlDoc); httpPost.addParam("username", "vip");

So what exactly does that mean? The entity of the post can contain many different formats. That's why is makes sense to create the concept of an entity. It's defensive programming. The user cannot use your interface to create some nonsense like I did above.

Also is that addParam a query param or a form param?

I guess maybe that design decision wasn't as dumb as you might think.

You shouldn't really complain too much about consuming the interfaces other people's libraries expose anyways. Your code should always use the ideal interface for your use case. If you are only consuming HTTP client to post forms then write an interface that is extremely geared towards that wraps the HTTP client.

Generally when I use ApacheHttpClient I am consuming a web service so I write an AppClient that maps all the APIs to simple method calls and abstracts the whole idea we're calling out over HTTP. My call would be:

appClient.login(username, password);

If you don't write the AppClient class or it's equivalent then it doesn't really matter what language or library you are using. You are going to have a really difficult time interfacing with a HTTP service.

→ More replies (3)

1

u/Appathy Feb 22 '15

with no real minuses other than implementation details are hidden.

I wouldn't say that's a minus... more like one of the fundamental axioms of OOP, and one of the best things about OOP.

1

u/kitd Feb 23 '15

I agree the verbosity is offputting, but I think a better fix is to provide builder objects with fluent APIs. This also helps when building models that need immutability.

→ More replies (3)

26

u/unruly_mattress Feb 22 '15

MetaModelVibratorVisitorFactory

These kinds of strawmen make me feel like "I don't have to read another word this person writes."

How is that a strawman? My current project has a class EntityManagerProvider that creates an EntityManager through an EntityManagerFactory, and another one named EntityManagerProviderProvider that provides the previous. This is not even a joke. EntityManagerFactory is standard Java, around 10% of the Java classes I know are named Handler and it's never not been like it whenever I was reading Java code.

11

u/[deleted] Feb 22 '15

I must be on the other side of the Java planet

15

u/[deleted] Feb 22 '15 edited Feb 22 '15

Classes ending in 'er' are code smell IMHO. 'Beer' being a notable exception.

5

u/Commander_Crichton Feb 22 '15

and *Controller

5

u/[deleted] Feb 22 '15

Good point, let's call it LocusOfControl ;)

→ More replies (1)

6

u/CyclonusRIP Feb 22 '15

His description of maven is what really lost me. He doesn't even understand that maven caches dependencies locally.

→ More replies (1)

5

u/[deleted] Feb 22 '15

What about Scala?

8

u/smithywill Feb 22 '15

I like Scala. It does away with a lot of the boiler plate code from Java. Although it does have a steep learning curve, the functional side of it teaches Java devs to be better programmers, it has for me anyway.

13

u/[deleted] Feb 22 '15

I'm glad you mentioned! It is a really powerful language! I think everybody should try Scala and its community to feel the higher-level easy development and break the slave chains of big companies.

6

u/superPwnzorMegaMan Feb 22 '15

It has quite the learning curve though. I thought I'd just start with it and see where it takes me similar to my groovy experience, but it took me quite a whilst longer to create functionality.

I really like the type inference and the immutability, so I'll stick with it for bigger projects in favor of java.

What I did not like is that scala is currently impossible to mix with groovy, it can be mixed with java, but not groovy (at least not in the IDE). You can however let your scala classes handle interpreted groovy scripts, which is pretty cool. So I don't think it should be that hard to fix this problem, I might take a look at it when I have time.

→ More replies (7)

12

u/[deleted] Feb 22 '15

Scala is a horrible language. It's far too flexible. The creators see c++ and thought it didn't give you enough ways to write confusing code so they added even more options. Everything in scala has like 5 ways you can call it and everyone does it a different way making using third party libraries a pain if you ever have to debug.

7

u/[deleted] Feb 22 '15

Scala is a horrible language. It's far too flexible.

Then what we should use? A language with zero-flexibility, like Go? Flexibility is very-very important to write verbose dsls for frameworks. It prevents to make disastrously ugly & non-verbose fws like spring and hibernate.

Everything in scala has like 5 ways you can call it and everyone does it a different way making using third party libraries a pain if you ever have to debug.

I don't know what kind of experience you have with Scala but debugging Scala is easy beacuse of typesafety.

→ More replies (10)
→ More replies (3)

8

u/DonHopkins Feb 22 '15

These kinds of classnames make me feel like "I don't have to read another line of code this person writes."

6

u/tetroxid Feb 22 '15

You'll love this

12

u/eff_why_eye Feb 22 '15

These kinds of strawmen make me feel like "I don't have to read another word this person writes."

I had the exact same thought and stopped reading the article right at that point. Next I suppose he goes on to complain about stuff in Java 1.2...

1

u/oneUnit Feb 22 '15

What about c#?

11

u/FireCrack Feb 22 '15

I feel like C# kind of inverts the problems of java. On the one hand it's got a way more usable standard library, on the other hand it's VM has until recently paled in comparison to the JVM, and still has compatability/portability issues.

5

u/f1zzz Feb 22 '15

Compatibility issues?

10

u/[deleted] Feb 22 '15

I assume he means the official VM is windows only

→ More replies (4)

23

u/btchombre Feb 22 '15

C# is awesome.. So long as you are only dealing with windows machines. Hopefully open sourcing the .NET core will make that better in the future

→ More replies (14)

5

u/[deleted] Feb 22 '15

What about it? Seems like a nice language.

→ More replies (22)

0

u/[deleted] Feb 22 '15

[deleted]

3

u/[deleted] Feb 22 '15

Java has way better standard library support for concurrency though. From what I can tell, C# lacks an equivalent for ConcurrentLinkedQueue and ConcurrentSkipListMap. Also no ForkJoinPool or Phaser.

3

u/Eirenarch Feb 22 '15

How is a ForkJoinPool different from a TaskScheduler - https://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler(v=vs.110).aspx

Also why do you care if your ConcurrentQueue is a linked list or not? .NET's ConcurrentQueue seems to be a linked list of small arrays but this is an implementation detail that I do not expect anyone to care about.

→ More replies (3)
→ More replies (1)
→ More replies (4)

1

u/Tulip-Stefan Feb 22 '15

I'm not sure why people see C and C++ as different languages in terms of performance. C++ code can be made as fast as C with 2 exceptions: no VLA's, no restrict keyword. I don't see VLA's used much in C, and most C++ compilers provide their own non-standard version of restrict.

If you want java to be as fast as the C family, give me true value-type classes and arrays, explicit simd instructions and relaxed atomics.

Without these features java will never be as fast as the C family for highly optimized programs.

2

u/F-J-W Feb 22 '15

relaxed atomics.

aka the nuclear landmines that won't help much most of the time. They have been called the single most experts-only feature in all of C++!

World-class experts like Stephan Lavavej fucked those up. And there are basically just two architectures on which you will gain anything from them (IIRC old ARM-versions and power-pc).

Oh, and their necessary price is completely undefined behavior.

So: No, you don't want them in Java. (And probably you don't want to use them in C++ either.)

→ More replies (2)
→ More replies (35)

25

u/DJDavio Feb 22 '15

I feel that the learning curve for making a solid real-world Java application or library is quite steep.

Imagine a newbie learning Java for the first time: Within minutes he has created his "Hello World" command-line program. But in the real world, everything has to be a dynamic web application so he dives into Java EE. Hmm, I need to host my app in a container, huh? Okay, I'll install Glassfish/Wildfly. Hmm, I need to output some JSON, but the default javax-libraries suck at this, let's see what's out there, GSON that looks okay, let's download it and put it in my lib folder....

The next day, a new version of GSON is released, so our newbie thinks "hmm, this is not a very effective way to manage my dependencies, there must be something to make this easier... oh, Maven, let's check it out!"

About a month later our newbie finally understands that group is mostly just a fancy name for project name and artifact is a fancy name for a library or application created within the project.

Now that his application is evolving he starts to think about testing, hmm, JUnit, let's add that and do some unit testing. Oh, but how do I unit test my spaghetti? Every object I create, creates many other objects. Can I just pretend that I have an object without triggering my entire application code? Enter Mockito. Oh and add Arquillian to make it more complex.

Finally, he has a Java EE app with dependency management, unit testing and mocking and btw he added it to source control. He chose Git because it seemed cooler than SVN.

But he's tired of doing everything manually and googles for "automatic building" and stumbles upon tools like Jenkins.

About half a year later, he feels he's finally comfortable of being in the real-world Java environment where there is a lot of stuff that isn't actually Java.

I don't know whether C# has the same problems or whether it provides a more complete ecosystem out of the box, but the hard part about Java is not the code itself, it's learning the ecosystem.

2

u/[deleted] Feb 23 '15

I just started my first software engineering internship and I can confirm there's a huge difference between knowing how to write some classes in Java for school and developing for an enterprise web app. And its exactly how you describe where I've spent the last 6 weeks figuring out everything that ISNT java before I finally realized that these things were being generated by / for use by Java.

1

u/DJDavio Feb 23 '15

I learned Java at university/college.

But in the real world I started out with C#/.NET. It was pretty easy to create something out of nothing and have it be not too far away from an enterprise application. I could develop in the standard IDE everyone used (Visual Studio), added Entity Framework, tested with MSTest and even did some remote debugging!

But then I switched jobs and had to do Java programming. First thing was to look for an IDE, hmm, there seemed to be an official one (Netbeans), but it isn't used much. IntelliJ costs money, so let's go with Eclipse.

Now, how do I setup my project? Maven dictates some structure so I guess I'll follow that one. But oh no! My colleague uses Ant and has his own folder structure. These steps were repeated for basically everything in the build cycle.

→ More replies (3)

3

u/[deleted] Feb 22 '15

I fully agree with this. The thing that makes Java bad is that it's old, and just keeps accumulating "things" that you need to know to be good at it. The amount of mental baggage that a developer needs to juggle distracts them from their focus on writing concise programs.

I remember working with some developers a while back that were relatively new to Java, and being frustrated because they weren't using some widely adopted packages and practices that make Java friendlier. Then I thought to myself, "Why isn't this built into the language?". The problem isn't Java itself; its that Java + "everything else" is too much to expect from an average developer.

That's what I like about Go. Sure, I can accomplish the same exact things in Java, but I have to add dependency x, process y, etc to get the same thing as the builtin features of Go. There's less to juggle in my brain. Will Go become bloated? Probably. Old languages always find a way. But I'm enjoying it in the meantime.

3

u/[deleted] Feb 22 '15 edited Feb 22 '15

[removed] — view removed comment

→ More replies (1)

2

u/I_Like_Spaghetti Feb 22 '15

What do blondes and spaghetti have in common? They both wiggle when you eat them.

3

u/DJDavio Feb 22 '15

How would Hannibal Lecter interpret this joke?

→ More replies (2)
→ More replies (9)

31

u/[deleted] Feb 22 '15

I like the part where he talks about how people dont know shit about how command line or their computer works and then makes it clear through his explanation of java and mvn and comparison with other programming language that he has no idea how computers work.

9

u/cptwunderlich Feb 22 '15

I agree with some of the stuff he wrote. But you have a point here.

Maven informed me that I needed to specify one of its entirely too many (30, by my count) ambiguously named “goals”. [...] “just compile the damned thing,”

Uhm, how about "mvn compile"?

(NB: I actually don't like maven, but that's another story)

2

u/sime Feb 22 '15

I defense of the original author, maven is garbage.

1

u/ErrantByte Feb 22 '15

Those statements came from different authors. (The article switches to a different Quora answer on page 2.)

1

u/horsefactory Feb 22 '15

I found this in contrast with what he says earlier. Doesn't he complain that a single line of Java declaring + initializing a hash map makes his mind dull - that he would rather spend time reasoning what a shorter (and possibly more cryptic) line of code does. Then he goes on to complain about maven, ant/xml, etc. and even declares in some case that he doesn't even try to understand what's going on. Seems a bit of a contrast in what he's preaching.

I thought the article started with some interesting points, especially about the Java culture and community - which I've felt always has been lacking or underdeveloped. Most internet searches for java related problems I've looked into will (if you're lucky) get hits on Stack Overflow. Otherwise you have answers dated ~a decade ago hosted on forums last updated around the same time (Java Ranch?!). I was disappointed that these thoughts weren't developed in the article, instead diving into nitpicks about the verbosity of the language and development/build tools.

I think that article clearly states how much he dislikes using Java, but has little foundation for its claims.

57

u/x-skeww Feb 22 '15

People get paid to write crap like that?

1

u/Swiggy Feb 22 '15

Not much, this is a "contributor" article. I believe they make a small % based on clicks.

0

u/[deleted] Feb 22 '15

[deleted]

17

u/x-skeww Feb 22 '15

I was of course talking about that article. It's just rambling.

4

u/keyslemur Feb 22 '15

Protip: It's Quora ported to a site.

14

u/x-skeww Feb 22 '15

Ah, so it's basically one level below blogspam.

→ More replies (2)

2

u/[deleted] Feb 22 '15

Welcome, fellow Smalltalker

0

u/[deleted] Feb 22 '15

[deleted]

14

u/[deleted] Feb 22 '15

Oh. My. God. No.

RoR is so nice and cute starting, but if you try to do complex things it turns into a nightmare. It's too opinionated, too intertwined, and too DRY, like almost every piece of Ruby code I'v seen. And add in performance concerns and it's a nightmare.

And that's ignoring the hellstorm that is getting the right version of Ruby installed, and the fact that probably 30% of Ruby libraries are shims into C code. Good bloody luck installing half the things you need on a mac, enjoy compiling QT or god knows what C/C++ lib on your CI boxes to match your dev setup.

Java at least you download a JAR and you're done with the deps bit.

→ More replies (3)

7

u/adrianmonk Feb 22 '15

Maven is unpleasant, but it's not Java.

I can't think of a reason why you'd ever want to use Maven instead of Gradle at this point.

→ More replies (2)

14

u/geodel Feb 22 '15

I have heard Maven problems will be solved with AbstractMavenFactory.

6

u/DonHopkins Feb 22 '15

That didn't turn out so great, but now they're working on ConcreteMavenIncinerator.

0

u/[deleted] Feb 22 '15

[deleted]

→ More replies (3)

4

u/tieTYT Feb 22 '15

What's your issue with Maven? I find it pleasant, but maybe I have Stockholm syndrome and don't know it?

0

u/[deleted] Feb 22 '15

[deleted]

→ More replies (2)

2

u/solatic Feb 22 '15

You must be joking.

Sure, Maven's documentation sucks and XML sucks. Yes, its a pain in the ass to migrate legacy Ant projects to Maven and getting them to fit into Maven's lifecycle. But once you make the migration, you understand that the constraints that Maven puts on your project make your build so incredibly rock-solid. We had a build that required a 20 page IDE configuration guide complete with FAQ and troubleshooting sections for onboarding and half the time it wouldn't work anyway back when we had Ant. We went from that to one-click effortless builds for everyone including CI once we deployed Maven.

Have the Maven libraries? Have a modern JDK? Have a working connection to a repo with all your deps and plugins? Then it just fucking works and that is such a Godsend that you have no idea.

Literally the only way you could improve on Maven would be to move away from XML configs and make it easier to write plugins. Otherwise, it's pretty close to perfection, if you agree with its constrictive design choices.

→ More replies (4)

27

u/apotheotical Feb 22 '15

You know what? I like Java. It's not cool. It's not sexy. It works, and is reasonably fast. It's got tons of library support, the syntax, though verbose, is simple and it's difficult to shoot yourself in the foot.

So yeah, Java and I get along. I don't know if Java for everything is necessarily the right answer, but I definitely get where the guy is coming from.

4

u/kenfar Feb 22 '15

I know a lot of guys that feel the exact same way about COBOL.

There's nothing wrong with getting comfortable with an awkward, unlovable language. Especially if it's commonly-used. There are worse languages to spend 8 hours a day, 12 months of the year, year after year with.

5

u/Dworgi Feb 22 '15

JavaScript and PHP come to mind.

5

u/[deleted] Feb 22 '15

I dunno, at least javascript is somewhat terse and doesn't suffer from "enterprise" API syndrome. It's kind of easier to avoid the awful bits of javascript than java. PHP though...

→ More replies (2)

66

u/[deleted] Feb 22 '15

I'm going to address some of the points from the first page because I can't be bothered to read the rest.

[..] a VM that has a macroscopic startup time [..]

That doesn't mean anything for applications with a measurable runtime. If you're writing a web service, you don't really care about the 2 extra milliseconds it may need to start up. Meanwhile, overall system performance tends to be excellent.

For real-world production servers, it tends to require a fair amount of JVM tuning.

Nope. Haven't run into a situation where that was necessary. At worst you need to increase the maximum heap size for a program that needs a lot of memory. That's not fine tuning. That's common sense.

The language sucks, [..]

Literally nothing else said to back that opinion.

[..] Java culture is one of mediocrity and bad taste, with MetaModelVibratorVisitorFactory classes dominating.

Juvenile.

[..] top Scala engineers [..] are really freaking good.

So are the top Java engineers. What's your point?

The only real issue brushed by is that there tends to be a large number of bad to mediocre developers working with Java. I don't know why that's Java's fault. Bad programmers follow success. Whichever language is in high demand (and so has the most jobs), has to bear the cross of having the worst programmers around it.

15

u/strattonbrazil Feb 22 '15

For real-world production servers, it tends to require a fair amount of JVM tuning.

I've seen stories where massive services will have a bit of JVM tuning done to be more efficient. Good for them. Seriously, what's the alternative? Running a slower language like ruby? The usual workflow I see is write something in ruby (or some other scripting language) just to get it up, switch to java for performance as many companies have done (Twitter, Google, Foursquare, etc.), and then do performance tuning because why use X machines when you could do the same work on half of them?

11

u/bcash Feb 22 '15

Engineers at Twitter have forked OpenJDK and run a modified JVM with an extra generation in the memory model. It's a clever optimisation alright, but it still would have worked without it. When you get to Twitter-scale shaving 5% of run-time equals quite a lot of saved cash.

But exactly as you say, what's the alternative? Re-write everything in C and do all memory management manually? That would almost certainly work too, but at the moment they have good performance and a high-level language (mostly Scala rather than Java, but still valid as it was JVM tuning we were talking about).

1

u/[deleted] Feb 22 '15

My rails apps run on the JVM now. Still tuning but much faster. Kind of a pain to roll the servers, but all in all, thanks java!

→ More replies (2)

3

u/MorrisonLevi Feb 22 '15

The only real issue brushed by is that there tends to be a large number of bad to mediocre developers working with Java. I don't know why that's Java's fault. Bad programmers follow success. Whichever language is in high demand (and so has the most jobs), has to bear the cross of having the worst programmers around it.

I thought you were talking about PHP for a minute.

/ducks

11

u/wtfdaemon Feb 22 '15

You kidding about the lack of need for JVM tuning? I've made a ton of money over the last decade specializing in performance/stability/scalability analysis and repair of JVM-based application servers. It's admittedly gotten a lot better over that time out of the box, but if you aren't doing some profiling (including with stress/load testing), you ain't doing it right.

2

u/[deleted] Feb 22 '15

As a professional android developer, I don't mind it. It's not my idea of a "perfect" language, but it is more than adequate for what I need it for

2

u/Bobby_Bonsaimind Feb 22 '15
[..] Java culture is one of mediocrity and bad taste, with MetaModelVibratorVisitorFactory classes dominating.

Juvenile.

I like that argument most, "the language sucks because the dev team had naming standards and actually stuck to them".

→ More replies (9)

23

u/rehevkor5 Feb 22 '15

The developer from quora who is reading interview code in java but doesn't even know how to build a java program without manually downloading jars and manually building a class path probably isn't qualified to be judging someone's java code. Seriously, not knowing the value of a build tool and a dependency management tool is what you'd expect from a novice. Maven is not really very difficult. Just because you didn't understand it immediately without reading a single word of documentation doesn't mean that it's shit. Also, there is more than just ant and maven out there: there's also Gradle and SBT. If you're going to talk trash, at least educate yourself first. Learn how professionals build their software: they're not manually building classpaths, I promise you that.

1

u/mibollma Feb 22 '15

Agreed! In case of gradle there is esspecially gradle wrapper which is checked into version control and would download all dependencies out of the box on any system.

21

u/nickguletskii200 Feb 22 '15 edited Feb 22 '15

What a shitty article.

Please find me a language that has:

  1. Comparable tooling

  2. A set of 3rd party libraries as rich as Java's

  3. Non-retarded standard library

This article doesn't even use modern Java... This:

HashMap<String, Set> depMap = new HashMap();

Should be written like this:

Map<String, Set> depMap = new HashMap<>();

I can't fucking understand what the author is suggesting. C and C++ absolutely can't be used where Java is used. OCaml has a rather small community. Haskell is just too hard to work with for most projects: it becomes a restriction, not a tool.

Edit: fixed code example, thanks /u/TomRK1089!

4

u/yogthos Feb 22 '15

Take a look around on the JVM. You have Clojure and Scala which are both very nice languages. They get the benefits of the exact same tooling and libraries. On top of that you get some nice tooling you don't get in Java. For example, Clojure allows doing REPL driven development and IDEs provide structural code editing. The JVM is a great platform, but there are very few compelling reasons to use Java the language today.

3

u/nickguletskii200 Feb 22 '15

I've used both Clojure and Scala, and I want to try Groovy next (although I'll wait a bit and see if it dies out since Pivotal is no longer behind it).

Clojure gave me a very bad first impression. I liked the language, but the implementation is horrible. Doing something incorrectly results in the compiler throwing exceptions instead of showing what in the code caused the problem. Documentation on some of the more advanced language features was scarce at the time.

Scala has different problems. Or at least it had the last time I used it (I doubt the situation improved though). Compilation is slow, IDEs are mindbogglingly slow and unstable and the language seems to love abusing operator overloading for everything. Oh, and I still don't understand why they chose Pascal-style syntax for variables, parameters, etc...

→ More replies (13)

3

u/TomRK1089 Feb 22 '15

You have your diamonds backwards. The diamond operator infers the RHS type based on the LHS declaration. It annoys some people; I don't particularly mind.

1

u/nickguletskii200 Feb 22 '15

Woups... Thank you, fixed it.

→ More replies (27)

8

u/lukaseder Feb 22 '15

If you don’t see that as an enemy worth all-out war, you’re either not human or not decent [page 2]

If you don't agree with me: Die a miserable death

4

u/kyllo Feb 22 '15

Lmfao as soon as I saw someone quote "vibratorFactory" I knew what was going on. Michael O Church is the best. 300+ comments and counting, for a repost of a java bashing article. What a champ.

34

u/faustoc4 Feb 22 '15

I will read this at work because in my own time I won't be reading about Java

15

u/_Sharp_ Feb 22 '15

"Ey guys, i hate java too! Am i cool yet?"

0

u/[deleted] Feb 22 '15

[deleted]

→ More replies (1)

3

u/Pragmataraxia Feb 22 '15

Meh, it's not perfect, but no other environment (programming languages don't really exist in a vacuum) has pissed me off less.

17

u/geodel Feb 22 '15

So much to agree with this while I work on a code piece with probably 20 lines of logic in 500 lines of java code full of 40-50 char long variable names.

9

u/MysteryForumGuy Feb 22 '15

Sounds like a problem created by the programmer and not the programming language.

1

u/[deleted] Feb 22 '15

Not only that but after mulling about this thread for a while I felt a renewed hate for "clever" developers who use single letter or similarly nondescriptive variable and function names. When I write lisp I can't say those identifiers are any different than what I would do in c++/java

→ More replies (2)

0

u/[deleted] Feb 22 '15

[deleted]

→ More replies (10)

13

u/[deleted] Feb 22 '15

Strange...I've never encountered these types of problems nor those types of programmers yet. I'm not sure I understand the frustration with the logger, but I can understand that Maven has a learning curve and its own way of doing things. But Maven grew out of Ant, which had its own problems where things tended to not be uniform between different organizations' code.

I understand that Java has issues that are resolved by other languages, but I'm still not sure why it gets so much hate. Bad coding styles are due to bad programmers, not the language in itself. GoF patterns can be translated between languages; they aren't unique to Java. Such strong language, and yet I haven't seen anybody point to open-source, well-known code bases that are infected with techniques as such. There is a time and place for everything, and so even the hate on GoF seems unjustified; rather than the patterns being the problem, its the programmers' fault for abusing them.

Java does attract a lot of sub-par programmers. But you know what? So does any other popular language. Programmers, no matter their skill level, need to make money and so learn marketable tools. I have met iOS app developers that didn't know the difference between a compiler and an IDE. Sound familiar?

→ More replies (1)

14

u/virus_dave Feb 22 '15

"by Michael O Church"

Consider the source. Knowing this guy's work personally was enough to make me immediately stop reading the article.

I'd really like it if r/programming stopped church-rolling me when I'm looking for actual well reasoned content. Stop feeding the troll, and maybe he'll end up somewhere else.

5

u/bcash Feb 22 '15

Knowing this guy's work personally was enough to make me immediately stop reading the article.

Ad-hominem attacks are a little bit uncouth. Especially with no supporting evidence. Does he have any publicly-visible code we could read?

3

u/[deleted] Feb 22 '15

This article? :)

1

u/Eirenarch Feb 22 '15

This is the second time I see something this guy wrote and a second time I see a comment that he should be ignored. In both cases the content supports the claim that he should be ignored.

1

u/abedneg0 Feb 22 '15

Yep, that's where I stopped reading, too.

→ More replies (1)

6

u/JakeIsPlaying Feb 22 '15

So... should I not be learning java?

15

u/[deleted] Feb 22 '15

Just make sure to learn some other languages as well.

7

u/MysteryForumGuy Feb 22 '15

Java is fine. This article is a non-majority opinion.

3

u/codygman Feb 22 '15

Depends on your goals.

4

u/DonHopkins Feb 22 '15

Java is a very useful tool for helping you appreciate C#.

6

u/Paddy3118 Feb 22 '15

The author mistakenly states that Python can't do parallelism as it has a 'GIL'.

Python does parallelism. Python does NOT have a Global Interpreter Lock. Jython (Python on the JVM) has no GIL. IronPython (Python for .net) has no GIL. C-Python has a GIL, and does parallelism.

Parallelism and Python needs more than an incorrect throw - away comment.

3

u/[deleted] Feb 22 '15

[removed] — view removed comment

1

u/Paddy3118 Feb 23 '15

As I stated, you need to further define your terms before one can have a meaningful conversation. I do parallel processing with processes quite happily in C-Python for example.

7

u/RushTea Feb 22 '15

Loving the bit about the guy struggling with Maven... In his command line. Yes, of course you hate a language when you don't grasp simple tools. Like an IDE. Or failing that, "mvn compile".

7

u/MaxPecktacular Feb 22 '15

What is with all the Java and OOP hate here? It's all very useful despite what some editorial thinks. If it doesn't fit your needs, great! Go use soa or a functional or a procedural language and have more fun. I personally like coding in Java, I usually end up with less headaches than using C++.

11

u/tramjoe Feb 22 '15

Warning: You are going to take the hit for many others too, don't take it too personally.

Here is what there is to it:

  • OOP is a butchered paradigm. It has been completely stripped in modern days of the fundationnal properties it had when invented, and has been travestied into something with absolutely none of the industry promises fullfilled.

  • Most of Java and OOP workforce is made of incompetent clones formatted by industry-standard training

  • The point is not C++ vs Java. You should broaden your horizon. The point is Java and C++ and others versus arguably better suited languages and paradigms for the challenges of today and tomorrow, notably concurrent and distributed systems, which are a nightmare to code right in Java or C++.

  • It is not about fun, it is about advancing the industry of computer programming, by picking interesting ideas from research.

  • The "being useful" argument is just leveling the field using the most common (smallest) denominator, staying in your comfort zone (aka stagnating and embracing mediocrity) and accepting to stick to "the way things are" despite the fact that the history of it is one of industrial compromises rather than technical excellence.

You are free to embrace mediocrity and stagnation. You are free to lock yourself voluntarily into a tiny sphere that becomes your IT universe. You are free to ignore attempts to make your field better, and rely on vendors and of-the-shelf corporate offerings.

But don't complain the day you realize that all you've done in your career is follow established rules you don't understand, leading you into obsolescence before you even realize it. And by all means, be my guest, it is only by contrast to the lowly mass of Java grunts that better, innovative, curious and ambitious programmer can shine.

Haaaa... now let the downvotes pour in (I have no illusions, I am attacking far more people in this comment than the group I am going to get a smile from), feels good to vent a bit for a change.

→ More replies (4)

4

u/contantofaz Feb 22 '15

Had fun reading those answers. :-) Thanks.

And that title was catchy.

I think the issue goes beyond Java. Layer upon layers upon layers of abstractions can affect other languages out there. Even new ones that should have known better. But in trying to be like Java, they may get very close to reinventing it all. Plus, they may depend on Java somehow. For example, for their IDE. :-)

The cure is like most medicine. It may not be sweet and painless like people would have wished for.

Even as we poke fun at Java, one thing remains: it's not easy to do cross-platform work in any language. For example, GUIs are better native. There's the browser's UI. And so on and so forth. ;-)

8

u/binford2k Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

Like write terrible and pointless articles.

2

u/unruly_mattress Feb 22 '15

Programs should be small, and when you need a lot of code to solve a large problem, you should create a system and give it the respect that systems deserve.

I'd like to understand this comment better. My company makes a network machine that does router configurations at runtime. It's a large, monolithic Java application, that takes its input from various sources (manual configuration, packets from the network...) and emits router configurations, network packets of various types, logging data and so on. How can such a monolithic application be re-architectured into a "system"?

2

u/kersurk Feb 22 '15

What is this shit article?

2

u/Zerran Feb 22 '15 edited Feb 22 '15

worthless clickbait. Are there no mods on this sub? This post should obviously be deleted.

2

u/gegtik Feb 23 '15

as soon as i read his rant about maven I realized how fundamentally ignorant this crybaby is

2

u/lexpattison Feb 23 '15

Consider the source. Looks like he didn't make very many friends with this type of broad opinion spewing during his career at google.

http://www.quora.com/Why-is-Michael-O-Church-notorious-at-Google

6

u/[deleted] Feb 22 '15

It's not the language, it's the environment,

4

u/cmiles74 Feb 22 '15

I've been doing Java for years and years and I've worked through several iterations of the tools. I feel pretty confident in saying that the language itself discourages me from using it for personal projects. Java 8 is making some real progress on this front, but there's still an awful lot of typing that feels repetitive. Personally, I think this is part of the reason I find Clojure so compelling.

1

u/[deleted] Feb 22 '15

Oh I agree, I've moved on to Scala myself, but most of what is described in the article is not Java specific, more likely it is due to "enterprise"-y practices, not the language itself.

5

u/[deleted] Feb 22 '15

Its the language.

→ More replies (1)

5

u/[deleted] Feb 22 '15

At the heart of the failed, ugly, corporate bastardization of “object-oriented programming” is an evil vision of the commoditization of programming talent.

hahaha looks like someone doesn't get the inherent impulses of capitalism.

3

u/[deleted] Feb 22 '15

If we are choosing technologies for our projects valuing something in terms "suck or not" - there is something wrong with us.

6

u/[deleted] Feb 22 '15

Ever needed any proof that idiots are in majority here on r/programming ? Then, well, this submission's score is positive.

3

u/satan-repents Feb 22 '15

So did PHP.

2

u/golfreak923 Feb 22 '15

Clearly this author hasn't ever tried to build a full enterprise application: database, back end, front end, test suite, some batch jobs, etc.--because doing that in Perl would suck--you'd be reinventing the wheel like 100x over. Meanwhile, a real Java programmer would be building it in Spring--making real progress--and doing it in many fewer lines.

1

u/zehydra Feb 22 '15

"HashMap<String, Set> depMap = new HashMap(); …I die a little on the inside. Because to me, that says, “depMap is a map, which is a map.”"

Sorta. It's setting a reference of type HashMap to a new HashMap.

24

u/[deleted] Feb 22 '15

Yes, Java can be more verbose, but that specific example is a very bad argument against it. That's basically how every other strongly typed language did (and some still do) things. Actually, that's not a very good argument either. So, here's more:

  • Polymorphism. The type on the left is what the following code expects to work with. The type on the right is the specific implementation. You could just as easily have Map<String, Set> on the left and new TreeMap<>() on the right. The lines that follow depend on depMap being a map, not a tree or hash map. This doesn't mean much for a silly example like this but in larger systems, it helps in more than one ways. Which brings me to,

  • Self-documenting. If you were able to do it without specifying the type, say something like depMap := getDependencies(), at a quick glance I can't tell what the type of depMap is. On the other hand, Map<String, Set> depMap = getDependncies() tells me exactly what's going on.

  • You don't really have to type it out manually. You'll be using an IDE. If you know how to use your IDE, you will type variable name equals to right hand side, press two extra keys, and let the IDE add the type -- selecting one if there are multiple viable options (because polymorphism).

8

u/ihcn Feb 22 '15

I think the argument is for compile time type inference, something every modern compiled language has, except java of course. Any IDE will tell you what the type is, without you having to type it out.

→ More replies (14)

15

u/depressiown Feb 22 '15

This bit of code annoys me for several reasons:

  • Unless you're using something specific to the implementation type, you could use the interface: Map<String,Set> depMap = new HashMap();

  • He's not using the diamond for the generic types: Map<String,Set> depMap = new HashMap<>();

  • He's not typing the Set: Map<String,Set<String>> depMap = HashMap<>();

  • Could use Guava to abstract the inner collection: Multimap<String,String> depMap = HashMultimap.create();

Articles/comments like these constantly annoy me. They're written by people who really aren't that familiar with clean, modern Java. Lambdas, ORM, libraries of annotations... there's so much stuff out there to simply how much Java you write and make it much cleaner than all these examples people use of why Java is bad.

→ More replies (4)

4

u/apotheotical Feb 22 '15

First, you forgot the diamond ("new HashMap<>()"). Second, you should never assign to concrete types if possible. Always use an interface or abstract where possible (simply Map in this case). This makes it easier to swap out implementations later!

→ More replies (7)

1

u/keenny Feb 22 '15

This reminds me of the dialog in "Thank You for Smoking" where the kid is asked to hand in a paper that explains why "government X is the best government". While in stead a proper task would be to answer "is government X the best government?".

1

u/teiman Feb 22 '15

Java is a tool, so it fullfill a role and works for a subset of what the world need, is ok to it exist and have this weird culture.

The complicators gloves produced code we see in the article may be neccesary when you are creating code for huge organizations.

I too don't blame java (the language), I think is possible to write fast and concise Java code using a different culture.

1

u/Scellow Feb 22 '15

Maybe for you, but not for me

1

u/valereck Feb 22 '15

TIL. Modern developers are crybabies apparently (according to Forbes)

1

u/[deleted] Feb 22 '15

I'm excited about leaving Java for Go. Java has been a great language but it's showing its age. However, this author is an idiot.

"Cult of Design Patterns" - EVERY language has these in one way or another. It is about as much of a cult as those pesky "touring-completionists".

Many of the problems that the author complains about are problems with developers not understanding why poorly organized code is hard to understand. It's not necessarily Java. Any language will run into these problems because things like coupling and cohesion are fundamental to computer science.

The grass may be greener on the other side, but if you don't learn your trade, you'll run into the same problems over there.

1

u/odiefrom Feb 22 '15

At the risk of losing my Programmer's License, Java has some great features, and if used to capitalize on those features, makes great programs. It is one of the most portable languages out there, where not only can you use one set of code, but you compile it once and anyone can use it. Java is great for "show and tell". When you need to express a pattern, demonstrate an algorithm, or get running a proof of concept, this is a way to do it that other people, even people less skilled in programming, can read and grasp a high level understand connected to a running program.

Java isn't an optimized language, its abstracted everything up hundreds of times, and its near impossible to really see how its core works. Yeah, there's room for improvement. But its a language that's being actively developed at a decent rate, and its proven itself over the last 20 years through constant use and adoption.

1

u/RICHUNCLEPENNYBAGS Feb 22 '15

I dislike pattern-soup but I don't know that that's really a problem with Java so much as "enterprise programming."

1

u/KayRice Feb 22 '15

with a little love, Haskell and OCaml can or will eclipse it in that domain.

Troll bait.

1

u/cafebeen Feb 22 '15

Haters gonna hate

1

u/bannerad Feb 23 '15

Oh, geez. No bias there. Nope.

1

u/alonjit Feb 22 '15

lol, its wrong and funny. proof that any idiot can write anything in forbes.

1

u/danogburn Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

blah blah blah, people complaining about imperative languages...Ada, C, C++, Java are the same fucking thing. please shut up. "wahh wahha wahh it's so verbose I have to have type information when I declare my variables"

The only abomination in today's programming world is web development. Specifically, html/css/javascript( and probably http) need to go. Why people keeping insisting on creating new frameworks and languages to compile into javascript is beyond me.

Web apps should be able to be developed in one language not six and should have an intuitive GUI toolkit (I want my widget to be this big and go here) just like most native platforms. The browser should just be a VM.

1

u/memgrind Feb 22 '15

90% of that was bitching about things not working easily in his 80x40 terminal, without an IDE. Or that type-systems exist at all, when his beautiful Perl can infer everything his 200-line programs have. What a waste of time.

0

u/PirriP Feb 22 '15

What a whiner.

1

u/riveracct Feb 22 '15 edited Feb 22 '15

I want to do Java in my free time because I always liked it but never got a full time gig in it...

1

u/GeorgeSharp Feb 22 '15

This is a great ... rant not an article, not an opinion piece simply one long "Java sucks" rant lifted directly from Quora, forbes just lost a great deal of credibility in my eyes.

1

u/franzwong Feb 22 '15

Personally I love Java on the backend side and Javascript on the frontend side. However, the development cycle of Java is slow, it cannot catch up. Every time I wrote Java, I need to import multiple libraries which I think they should be included in JDK.

For syntax sugar, C# is better. Syntax sugar increases readability and ease code review to spot bug.

1

u/lexpattison Feb 23 '15

An opinion from a non-java developer about every other java developer - come on. Developer's are professional critics and shiny object chasers... so it's inevitable that Java is going to get a lot of criticism and newer (50 year old) programming languages are going to get some positive attention due to their niche status and functional efficiency/conciseness... but let's not assume too much here. Java has a lot of value... the JVM even more.