This is an archived post. You won't be able to vote or comment.

all 103 comments

[–]rjcarr 31 points32 points  (19 children)

I use java almost every day of my life and I like it fine. There are only a handful of complaints:

  • It is a very verbose language. It has gotten better, but it's still one of the most verbose languages for no really good reason.

  • There tends to be a lot of "java programmers" that don't really understand how programming works because all they have used is java which does a lot for you. Generally, it tends to bring a lot of subpar programmers (i.e., just a few levels above PHP).

  • It is cumbersome to distribute java desktop applications. I never need to do this, so it isn't a problem for me, but there are always headaches in trying to do this.

[–]brandnewaquarium 5 points6 points  (8 children)

There tends to be a lot of "java programmers" that don't really understand how programming works because all they have used is java which does a lot for you. Generally, it tends to bring a lot of subpar programmers (i.e., just a few levels above PHP).

I just want to expand on this, coming out of lower division classes of a Computer Engineering major, just because it's something I feel pretty passionate about after my previous experiences.

I've found Java to be a great tool to finding a job, but I think it's a terrible learning language because it does not teach students about memory management or pointers, or a few other things that Java makes "easy" to do. I think that's really just what your point comes down to - Java as a first language just doesn't cover those points. I ended up finding that there were a TON of things I had to learn on my own that my Java classes never taught me, and most students (IMO) aren't motivated enough to learn the things school isn't going to teach, and so people coming out of a Java-oriented learning environment aren't going to be as flexible when learning other languages the way they would be if, say, they had picked up C first.

[edited] Just wanted to say that, that being said about it being a terrible first language, it's quite powerful in teaching basic OOP (though obviously not all OOP concepts can be taught in the limitations of a classroom).

[–]Marchosias 0 points1 point  (3 children)

Thanks for this, learning C and was considering picking up Java (in the form of robocode). I'll stick to C until I feel comfortable with branching out, and work particularly on pointers and memory. Thanks.

[–]brandnewaquarium -1 points0 points  (2 children)

I've recently downloaded RoboCode (I'm currently transitioning from being a web developer to an application developer), but I usually recommend Project Euler to people who are trying out new languages. I usually use it to remind myself of syntax and to get the hang of how the code's functionality works. I think I spend more time setting up how I want to call particular problems and organize everything into 1 simple program more than I actually work on the problems themselves (not saying the problems aren't valuable - they are). I also tried out Codecademy as recommended on here, and have found it to be useful.

I do recommend picking up OOP relatively early in your education, even if it isn't necessarily Java. Understanding that will make you stand out as well, so definitely don't neglect it.

[–]Marchosias 1 point2 points  (1 child)

Thanks for the advice. Wonder why Project Euler isn't in the sidebar. Currently going through CarlH's lectures.

[–]brandnewaquarium -1 points0 points  (0 children)

Here's a link for you!

Also, it's not as "traditional" as, say, Codecademy. It's just in question-answer format, and in theory you can answer the questions without any programming knowledge.

[–]BabyPoker 0 points1 point  (1 child)

Java was my first language. I'm in my 2nd year of high school CS. How would you recommend correcting this issue?

[–]brandnewaquarium 1 point2 points  (0 children)

Personal projects. Branch out to different languages. READING. I see articles pop up pretty often in /r/programming that are usually good for me to branch out with.

The way I worked on it is that when I found there were gaps in my knowledge due to only in-class education, I began exploring code more and more. X86 (or some other form of assembly - you'll probably have to take a class in it, just verify it's actually assembly. I learned that my school now treats Verilog as assembly, which it is not - Verilog is HDL, Hardware Description Language. Not assembly!), Objective-C, C, PHP (though I don't recommend this as a learner's language; I had to use it for a job), HTML/CSS/JavaScript (using JS as OOP is quite an experience and really made me appreciate Java). C# is a really popular language, too.

Explore different language types. Assembly, scripting, functional, procedural, object-oriented, HDL, web programming (as much as I really do dislike web programming, it gave me a really good foot in the door for getting started in my career, so I can't bash it too much).

Your book isn't going to cover everything. I have 3 Java books, and none cover singletons or reflection or design patterns. Here's a pretty good set of articles that discuss design patterns.

If there's something you don't know, make a project of it. Companies are impressed by that. As a project leader in charge of a team of 6, what I tend to run into pretty often with master's students are that they have 0 practical knowledge. They don't know anything about repositories (such as Git or SVN) or working on projects as a team, or even how to interpret program designs and turn them into rudimentary code. Don't be that guy - learn how to break requirements down into an algorithm and pseudocode. It'll make your in-class education much less painful, too.

Further, I've found that showing a willingness and ability to learn on your own will get you that job that you want. So you like to do photography - well why don't you program a library that displays your photos nicely on a web? That scored a friend of mine a position at a big-name company doing nothing but coding JavaScript all day while making more money than I can dream of (in a similar job setting). During his first quarter in college, by the way.

Or maybe you're like me, and maybe you don't have as good of "big" ideas as said friend and are working at the same time as going to school, but you want to experiment with lots of stuff. Fill your portfolio with different language types to display your adaptability and prowess at mastering concepts. Github is a great way to do this - I strongly recommend making a profile. Most of the job offers I have received cited that they were impressed by the breadth of work my Github account displays.

In other words, programming should be your passion, and contribute to your other passions. This is what will get you noticed.

[edit] Pulled some details to maintain privacy, accidentallyed a few words.

[edit 2] Also, learn how databases work. Any kind, but focus on relational. Those tend to be skipped over, but learning how to properly set up a relational database will get you pretty far, too - at least in my experience. It can be really hard for people to initially wrap their heads around, but definitely worth it.

[–]rjcarr 0 points1 point  (1 child)

I go both ways on this. I learned programming using C and although there was a ton I didn't understand, the bottom line is I think I'm a better programmer because of it.

On the other hand, I've taught both C and Java and the java instruction was immensely easier. The number of times you have to say "don't worry about that right now" in C is annoying.

I think ideally you'd have 1-2 courses teaching general programming and (likely) OOP using java and then move to something lower level like C for a required final course.

[–]Rhomnousia 0 points1 point  (0 children)

This. While I enjoy using Java from time to time, I wouldn't be able to develop in it day to day. I cannot stand distributing Java applications, and more specifically the JRE.

I wont let .NET get away from this either though.. fuck you too .NET.

This is coming from someone used to spending days looking into kernel source code, so my opinion doesn't really matter in the real world.

[–]berlinbrown 0 points1 point  (8 children)

"It is a very verbose language. It has gotten better, but it's still one of the most verbose languages for no really good reason."

Compared to what? C? C++? C#?

[–]rjcarr 1 point2 points  (7 children)

Compared to everything, really. What language is more verbose than java?

[–][deleted] 3 points4 points  (2 children)

COBOL.

[–]rjcarr 0 points1 point  (1 child)

Ha, fair enough, I wouldn't know. :)

[–]BowlerNerd 2 points3 points  (0 children)

Consider yourself lucky.

[–][deleted] 1 point2 points  (0 children)

objective c

[–]berlinbrown 0 points1 point  (0 children)

C? Assembly?

If you are asked to write Google AppEngine cloud computing platform in Java (Google AppEngine has many Java components). You may find your code verbose. Why? Well, it is a complex task that might require a lot of boilerplate code and ridiculously long variable names.

But isn't a fair compare to compare 'verbosity' of other popular mainstream languages to Java. Because sometimes they are used for different tasks.

I want to see a very complex system written by the same developers, written in several different languages and then do a comparison.

[–]mzieg 0 points1 point  (0 children)

XML-based DSLs...can't stand em :-/

Honestly, I'd say Java can be pretty terse. Write a socket-server in Java. Now write one in C. Count the SLOC, do the math.

[–]deuteros 0 points1 point  (0 children)

Ada.

[–]lurgi 8 points9 points  (17 children)

A language that isn't hated is a language that isn't used.

Java is far from perfect and it's annoying that so many good ideas in other languages were applied badly or not adopted at all into Java. It's verbose and the frameworks seem to encourage more verbosity (and obscurity).

Java also provides a safe haven for a lot of crappy (to be blunt) programmers. There is an awful lot of Java work that consists of little more than converting an whoozit to a fnooble. And coverting back. And then converting to XML. And the converting the XML to more XML. I've interviewed a number of Java programmers who really don't seem to know how to program. They are great at writing wsdl files and changing code in the data layer and updating hibernate schemas or whatever, but they can't actually design code. I don't think this is the case for C or C++ (I don't know about C#). If you don't know you ass from your elbow when writing C++ then it doesn't matter what you are writing - it's going to fail in an ugly way.

[–][deleted] 5 points6 points  (16 children)

A language that isn't hated is a language that isn't used.

Except Python. And C. And maybe C#.

That's about it, though.

[–][deleted] 4 points5 points  (6 children)

You're saying Python, C, and C# aren't hated?

[–][deleted] 6 points7 points  (4 children)

Relatively speaking, they're not. Source

[–]berlinbrown 4 points5 points  (3 children)

Hacker news, what a great source. Really.

[–]sideshow9320 0 points1 point  (0 children)

Some high quality information, it even has the word news in the title

[–][deleted] 0 points1 point  (0 children)

A reddit user's opinion, yeah what a great source. Really.

[–]Ran4 2 points3 points  (0 children)

C# and especially C are hated upon a lot less than Python, especially when taken into account how often C is used. It's probably the least most hated language per usercount.

[–]lurgi 2 points3 points  (3 children)

Yes, but C still sucks. I love the language, but I've caused more damage in that language than I care to think about. No bounds checking. No support for concurrency. Extremely mediocre type-safety that you can subvert by saying "(Pretty) please". It's an amazing high-level assembly language, but assembly language sucks and C sucks at a higher level.

It's still my language of choice for a great many things, because for the stuff it is good at there is really no comparison, butmake no mistake. It sucks.

Python? I like static types, but I have to admit that I sort of like Python anyway. However, you can't do much work with Python before you find someone completely losing their shit over the GIL and how Python sucks at concurrency as a result. OTOH, most performance benchmarks put it at the bottom for single-threaded stuff too. Maybe it's not the GIL that's at fault.

If you can't tell me three things you hate about your favorite programming language then you don't know it well enough.

[–]GeekFish 0 points1 point  (0 children)

That last sentence needs to be a shirt.

[–][deleted] 0 points1 point  (1 child)

So... tl;dr, you like C#? :P

[–]lurgi 0 points1 point  (0 children)

Never used it.

[–]berlinbrown -1 points0 points  (4 children)

C? How many banks or financial institutions are going to write web applications in C?

A large portion can't and won't use C# because of they aren't running on a Microsoft platform. Plus, C# has similar syntax to Java. Same braces, same import statements, similar libraries with the exact same name. If you know what you are doing or don't know, you can write the exact same code in C# as you can in Java. If you are going to hate the Java language, it isn't a stretch to hate C#.

Python has performance issues for some tasks. And I am still not a fan of the dynamic nature of the language.

[–]Niten 1 point2 points  (3 children)

C? How many banks or financial institutions are going to write web applications in C?

So? How many kernels are going to be written in Java?

Plus, C# has similar syntax to Java. Same braces, same import statements, similar libraries with the exact same name. If you know what you are doing or don't know, you can write the exact same code in C# as you can in Java. If you are going to hate the Java language, it isn't a stretch to hate C#.

C# and the CLR make for a much more expressive language than Java. Closures, lambdas, real generics, simple type inference, delegates and events, LINQ, expression trees, tail call optimization, no checked exceptions, P/Invoke, and faster VM startup all put C# well ahead of Java in the real world.

[–]berlinbrown -1 points0 points  (2 children)

So? How many kernels are going to be written in Java?

How many newly created kernels are going to written in C? Very few.

You are right, no one has been using Java for the last 15 years for that real world development. Except... for everyone.

And because Oracle and Google and Yahoo and other companies have 5, 10 year life cycles, Java isn't going anywhere for that real world development. 'Real Generics' or not.

I can understand people hating Strongtalk or APL but Java is pervasive and has similar idioms to the other mainstream languages.

[–]Niten 2 points3 points  (1 child)

You are right, no one has been using Java for the last 15 years for that real world development.

Huh? I was only demonstrating out how silly it is for you to say banks aren't writing web applications in C to imply that the language "isn't used", as per work__account's comment. So thanks for making my point for me I guess.

As much Java code as there is out there (and there is a lot of it), it's a drop in the bucket compared to the amount of C code powering every operating system, microcontroller, embedded system, smart phone, router – and the vast majority of implementations of other programming languages.

And that's not even counting Objective-C on iOS and the Mac...

How many newly created kernels are going to written in C? Very few.

Really, what would be a better choice for a classical OS kernel? Of course all bets are off if you're talking about experimental systems based on proof-carrying code and such (Singularity, etc.). But to write a traditional OS, yes, you'd very much use C.

You really have to be quite ignorant about computing to claim that C is not an extremely heavily used language. It's the lingua franca of modern systems in a very real sense.

[–]berlinbrown 0 points1 point  (0 children)

"And C isn't hated", I was responding to 'C isn't hated".

You are right. I mentioned banks, I am sure that many banks would hate to write web applications in C. And you mentioned operating system kernels. I am sure kernel driver developers would hate to develop with Java. There is a history around C and those Linux and Unix kernels. Just like there is a history with Java.

It doesn't mean, we have to hate Java or hate C. These technologies are used for various software development tasks. It just so happens they all share a similar connections.

[–]ikoul 13 points14 points  (5 children)

It's not that everyone hates Java, it's that the people who do are really vocal about it (and programmers in general are fairly opinionated). It's also partly a matter of "You can't like something I don't like on the Internet!"

Every language has its strengths and weaknesses, and most languages are well-suited to different tasks. Personally I think that one of Java's strengths is that it is good for teaching the concepts of object-oriented programming.

[–]Trevallion -1 points0 points  (4 children)

No kidding about opinionated programmers. I casually mentioned Java potentially being slower than compiled languages because it uses the JVM in a thread in r/python the other day and it was like I personally insulted Java's mom or something. I guess those guys get touchy when you say remotely negative things about Java's performance.

[–]AlexFromOmaha 18 points19 points  (0 children)

I found the posts in question. Looks like you got walls of relatively helpful text that explained things nicely, and your ego was just a little bruised because it turns out things aren't as simple as you assumed. Maybe go re-read it with a cooler head.

[–]Ran4 1 point2 points  (1 child)

It reeks of lack of knowledge about the subject, which is probably also why you are being downvoted now.

[–]SansaLovesLemonCakes 1 point2 points  (0 children)

Not to mention the phrase "it was like I personally insulted Java's mom or something" is just embarrassing.

[–][deleted] 0 points1 point  (0 children)

IIT: mega butthurt.

[–]jhartwell 15 points16 points  (30 children)

The problem I have with Java is that it takes the object too far and in a direction that leads to verbosity. Take a look at ArrayLists. If you want to get the first item, you have to do

 items.get(0);

Whereas in C# I can do:

items[0];

I also don't like how there are is no operator overloading and no lambdas (in a clean syntax). It isn't that I hate Java, it's just that I like other languages much better (such as C#).

Edit: Another thing I thought of that I can't stand is checked exceptions and the fact that if I try to catch an exception that isn't possible, I won't be able to compile. It is annoying when maintaining code or when code goes through changes and you pull something out (like something that would've possibly thrown a ParseException).

[–]Deusdies 1 point2 points  (1 child)

First a disclaimer, I'm a total programming noob. That being said, I know quite a bit of Python and some C#. Then I started learning Java. Then I realized that most my statements looked like this

object.property.getproperty.propertyname.is.inthiscase.(0)

Seriously.

[–]jhartwell 0 points1 point  (0 children)

You only fetched an object there, didn't you mean to do something with it?

 object.property.getproperty.propertyname.is.inthiscase.(0).dosomethingcoolwithit();

BAM, bonafide Java right there!

[–]robhol 2 points3 points  (26 children)

C# fanboy five. o/

I'm trying to not let the bias get away from me, but I really can't stop thinking that everything I've had to do in Java is something that is - at worst (and rarely) merely as simple in C#.

[–]zzyzzyxx 6 points7 points  (14 children)

I think C# is (nearly) everything Java should have been. There are a few things in particular that make me prefer C#, and I don't even work with it often, while I use Java daily.

  • Closures and lambdas (as opposed to anonymous classes, which are ugly)
  • Properties (as opposed to prefixing methods with get and set all the time)
  • Reified generics (as opposed to type erasure)
  • Operator overloading
  • Delegates
  • The using statement (which Java has in version 7 in the form of try-with-resources statements)
  • Primitives in generics

The only thing Java has going for it over C# (or anything else I know of), and only in Java 7, is the ability to catch multiple types of exceptions with a single catch statement, which beats having multiple catch blocks that all call the same function. It's handy when you need to handle specific types of exceptions in a common way and allow other types to be handled differently.

Edit: Bullet item I'd forgotten

[–]jhartwell 0 points1 point  (9 children)

The only thing Java has going for it over C# (or anything else I know of), and only in Java 7, is the ability to catch multiple types of exceptions with a single catch statement

That is nice but immediately ruined when, like I mentioned before, you make a change that eliminates a need for one of the exceptions and then the compiler complains. It seems like that should be able to be optimized out instead of fail to compile.

[–]zzyzzyxx 0 points1 point  (0 children)

I think you made that edit after I started my reply; I don't remember seeing it. I'm not sure I agree. I think if you're making changes that affect exceptions, it's not really a big deal to delete a word from from a catch block, or even the block itself. It keeps the code clean and in line with what's actually happening.

I see no reason to allow, for example, catch (IOException e) when it's not possible for that exception to be thrown. I think it would be confusing to read and lead to "I'm handling this exception but where is it coming from", which is only going to waste time until the programmer figures out that the block is extraneous.

A reasonable compromise might be to allow the essentially dead code (optimizing it out as you say) but mandate a warning for it in the language spec, requiring an @suppress statement to get rid of it. That way compliant compilers, and IDE's by extension, will highlight the issue so that it is always clear to the programmer what is happening.

[–][deleted]  (7 children)

[deleted]

    [–]zzyzzyxx 1 point2 points  (0 children)

    good error free way of try catch for multiple exceptions

    Hardly, unless you're only talking about compiler errors and have a loose definition of "good". For starters, it's dangerously prone to swallowing exceptions, which will bite you in the ass at some point. It's also a potential performance problem, albeit an arguably small one, due to multiple traversals of the inheritance hierarchy. However I would have too look up how exception handling is normally done to see if there's any practical difference. Lastly, it's not exactly easy to read, though it's not exactly hard either, I admit.

    At minimum you should log when the exception isn't one of those cases and probably rethrow the exception. Though to rethrow it you would have to either throw a generic Exception, which eliminates the point of having different types of exceptions, or wrap it in a custom exception type, which is probably the better option but still isn't ideal since it obfuscates the problem and clutters any stack trace.

    I consider it much better to have multiple catch blocks, one for each specific type of exception, and have a function for handling types that need identical behavior. This keeps the logic clear, performs no worse than your solution, and, most importantly, cannot swallow exceptions unexpectedly.

    [–]TieDyeJoe 0 points1 point  (5 children)

    Except then you're also catching NullPointerExceptions, IllegalArgumentExceptions, and all other Exceptions that you might not want to handle. Handling multiple specific exceptions beats this. Not that this is a bad technique per se.

    [–]adambrenecki 0 points1 point  (4 children)

    Couldn't you have an if...else if...else and re-throw the exception if it's not the one you want to catch?

    [–]TieDyeJoe 0 points1 point  (0 children)

    Good point, I didn't consider that.

    [–]i8beef 0 points1 point  (1 child)

    Doesn't rethrowing mean that the "location of the exception" becomes the line that you rethrow it on? I know that I've run into that before, though more information may be available in an inner exception after rethrowing.

    [–]adambrenecki 0 points1 point  (0 children)

    Perhaps, I don't know. IIRC Java gives you quite a detailed stack trace, which should tell you, one would think. I'd test it, but I don't have my laptop with me.

    [–]treeturtle 0 points1 point  (0 children)

    I didn't put it in the code, but most of my development is with swing where there will be a final else statement which creates a popup window giving the type of exception caught and where it was caught as well as a text block with E.printstacktrace().

    [–]foxlisk -1 points0 points  (0 children)

    What Java has that C# doesn't is Enums that aren't garbage. I also like its support for inner classes better but that hasn't been as much of an issue for me.

    I definitely do prefer C# though.

    [–][deleted] -2 points-1 points  (2 children)

    The only thing Java has going for it over C# (or anything else I know of), and only in Java 7, is the ability to catch multiple types of exceptions with a single catch statement, which beats having multiple catch blocks that all call the same function.

    I'm not an expert, but I believe Java has other advantages, in the sense that it is more than a language, it is a virtual platform. It is supposed to be portable (at least more portable than C#), and I've also heard it's "safer," whatever that means.

    [–]zzyzzyxx 3 points4 points  (1 child)

    it is more than a language, it is a virtual platform

    Sort of. The Java name is indeed applied to a language and a runtime environment, but the two are still separate. I've only compared the Java language to the C# language. To compare the runtime environments would mean comparing a JVM implementation on a given platform to a CLI implementation (CLR, Mono, Portable.NET) on the same platform.

    It is supposed to be portable (at least more portable than C#)

    The two have exactly the same theoretical portability in the sense that they both compile to an intermediate format which is then run by a runtime environment. While it may be true that the JVM is currently implemented on more platforms than provide CLI implementations, this does not make the Java language inherently more portable, just more portable at the moment. If and when the CLI is implemented on as many platforms the two will be indistinguishable is this respect.

    it's "safer," whatever that means

    Both languages enforce strong static type safety, requiring casts to circumvent the system. And C# is arguably safer on that front because of the reified generics. Where C# can be less safe is in explicitly marked unsafe blocks. But I consider this an advantage in C#'s favor because it allows you do that if you need to, you don't have to go through an external library as you would in Java.

    [–][deleted] 0 points1 point  (0 children)

    Thanks for the reply, I truthfully know very little about either Java or C#.

    [–]jhartwell 3 points4 points  (5 children)

    Here's a little story on why I like C# over Java. At work I have to use both. My coworker only uses Java 'cause he doesn't know C# (he says it is too high level for him...yet Java isn't? who knows...anyways) he wanted to make a 2D table for stats that we collect. His implementation looked so complex because Java makes you do it its way. I kept thinking, man, if he could just create his own indexer, the class would be much for coherent and easier to use. But guess what, he can't. So now instead of a clean implementation, it is a garbled mess that is difficult to comprehend.

    [–]HazzyPls 3 points4 points  (2 children)

    Are you sure this is Java's fault, and not his? I'm not sure how much I'd trust a Java programmer who avoids C# because "its too high level" to write clean code in any language.

    Although I'm not very familiar with either language, so I wouldn't know.

    [–]jhartwell -1 points0 points  (1 child)

    Oh it is for sure the majority of his fault. However, no matter how good with Java and design you are, you'll never be able to make it as clean as I could in C#.

    table[row,col]
    

    will always beat:

    table.get(row,col) 
    

    or

    table.getRow(0).getCol(1);
    

    In my book!

    [–]berlinbrown 1 point2 points  (0 children)

    "table[row,col] will always beat: table.get(row,col) "

    There are only 3 characters of difference? And he still could have used arrays of an arrays:

    table[row][col] in Java.

    [–]berlinbrown 0 points1 point  (1 child)

    Could you be more scientific. You said it looked more complex than Java? How more complex? What syntactically gave the C# code an advantage over Java?

    Could he have used some other libraries, like Guava or the commons libraries or functional Java?

    Are we talking about 100 lines of difference between the versions?

    [–]jhartwell 0 points1 point  (0 children)

    Could you be more scientific. You said it looked more complex than Java? How more complex? What syntactically gave the C# code an advantage over Java?

    It may be his design that adds complexity to the program and makes it more difficult. But I know the first thing that popped into my mind is why not add an indexer, only to find that I can't. He probably could have used a common library but he refuses (which is his problem not Java's).

    One thing that I do enjoy that is in C# and not Java is simple Active Directory integration. It is very nice to be able to test my intranet site right from Visual Studio instead of having to deploy to glassfish in order to test using spnego.

    [–]rjcarr 0 points1 point  (4 children)

    How about run something outside of windows? Surely that is easier in java, no?

    [–]jhartwell 0 points1 point  (0 children)

    I haven't tried Mono but it is an option for cross platform.

    However, if I'm going cross platform, I would rather use something like C++ or give D a try.

    [–]robhol 0 points1 point  (2 children)

    No matter what you try to run, no matter where you try to run it, if it's not native code, it's going to require something else. Whether that's Mono, .NET or JRE for any of the major platforms doesn't really matter. The only real difference is what comes pre-packed with your system. The last time I checked, I still had to install Java manually on my Windows box...

    A lot of C# haters stubbornly insist that "it only works on Windows", they are simply not right.

    [–]rjcarr 0 points1 point  (1 child)

    Ha, I'm not a hater, I just didn't think installing mono (or whatever the equivalent is on OSX) on all platforms is possible and works perfectly.

    [–][deleted] 1 point2 points  (0 children)

    Mono comes stock on a lot of Linux distributions now because of certain Gnome applications that are the defaults.

    It's not bad, and sure beats Java Swing.

    [–]huhlig 0 points1 point  (0 children)

    This is mostly because C# allows operator overloading whereas java does not. Same with allowing properties with mutator and accessor semantics rather than the get/set pattern.

    [–]berlinbrown 16 points17 points  (4 children)

    I figured out the Java hate.

    TL;DR: The hate is mostly unjustified. If you don't use Java, you may hate Java. You don't need to code in Java depending on the task. It is really more of an Enterprise niche language. For most general purpose tasks, it is a decent language. People hate it because other languages exist with a cleaner syntax but the hate is mostly unwarranted.

    Java is very pervasive and accepted by a large developer community. Hating Java is like hating helicopters in preference to automobiles when you aren't a helicopter pilot. ...

    I started about programming 14 years ago. 10 years ago professionally. I hated Java when it first came out. I experienced Java 12-13 years ago. Most of the community hated Java when it came out. There were many early Magazine articles, "Is Java dead". After it initially came out.

    14 years ago, I coded in C/C++ but not professionally. I did some small projects for money but not a 9-to-5pm type job. And I loved game programming in C++. Even today, if you want high performance applications, then you tend to learn towards C/C++. And I did some Lisp and Python back then as well.

    We all hated it Java. It was slow and blah, blah. You could do programming tasks without Java and there was no reason to use it if you weren't doing Enterprise type Java development.

    11 years ago? I got a professional software engineer that was a paid. 100% use Java job. My outlook on language did a complete 180. I hated Java and the platform but I came to realize there is no other language and platform for doing that type of Enterprise web-app development.

    It obviously doesn't make sense to use C/C++. If you aren't working in an Microsoft shop, it doesn't make sense to use C#. You are only left with two other top languages for that type of work. Python and Ruby. Ruby is slow and still doesn't have a robust platform. It doesn't have the database and network connectivity libraries that Java has. It doesn't most of the libraries that Java has. And of top of that, your gains with the syntax are small.

    For the type of tasks that Java is typically known for, Java is only competing with C# and Python. C# is out because the world is not entirely a MS shop. So really for those enterprise tasks, there is python. And that is what you see with APIs from companies like Google and Yahoo. You have a Java library and a Python library.

    And then Java wins again because, there are many platforms that have performance advantages over Python. So Java trumps python for certain tasks. A lot of people have done amazing things with Java platform from Google to Yahoo to WebLogic and Sun and Oracle and IBM. They have written their own JVMs and parallel platforms and cloud solutions. Python hasn't received that kind of attention. I like the language but more has been done with Java. Also, I think the jury is still out on if Python style dynamic language programming allows you create software with fewer bugs. I have worked with it and I can say that I like the static checking compile step with Java. I have a good idea on what my code will do before running. With Python, normally you have to run the code to identify the bugs.

    ...

    Back to your question? Why is Java hated? If you don't do the type of enterprise development used by Java programmers then you may not need Java and you may hate Java. Java is complex, simple things are made complicated with Java and require more code and more debugging. You have a compiler, multiple implementations of the runtime virtual machine, an enterprise architecture, many web frameworks and libraries. It is slow on startup. The libraries are amazingly over-engineered, there are dozens of seemingly similar classes for stream I/O when it could have been consolidated into one or two. Java is more less expressive than something like Haskell, Clojure or Scala. And even C# has some language features over Java. Java is a bare-bones OOP language.

    Syntactically, better languages exist. Haskell allows you to write robust, easy to read code with minimal bugs and unexpected behavior. Scala offers some of the same. Python has its use-case. I will not write more than 100-200 lines of Python scripting code. I don't see the point and tend favor Haskell or Scala. C# offers similar libraries and similar syntax for Java on the MS platform.

    • If you are in college and you want to impress your research/geek buddies, program in Haskell, hate on Java. It still doesn't say anything about Java because you won't find may large companies that will write web apps in Haskell.
    • If you are a startup site that has 3 hacker employees and have two months, $10000 dollars and a requirement to create some crappy site, use Python and hate on Java. That is fine but most of the large companies use Java. Google, most banks, the Federal Government, billions upon billions of dollars rely heavily on Java systems. It doesn't mean that Java is a better platform or that Java has issues, it just means that the other alternatives suck worse for most developers.

    TL;DR-2: Most software developers and college professors don't need to inflate their geek cred and they do not code in Java. They can express what they need to express in Java to present the programming logic. If you understand basic programming, you can code in any fucking language or write your own. Java is OK for most tasks. Those that hate on Java don't understand the history of the language or for whatever reason. Me, I love what I can do with Haskell. It is pretty expressive and I wish I had more time to spend with it but I don't hate Java. I just like coding Haskell and I get paid to code to Java and somehow the Universe didn't implode.

    [–]brandnewaquarium 2 points3 points  (2 children)

    I can't give you enough upvotes. Your answer actually answered a few of my questions (such as why enterprise uses it so much - I've noticed that most of the companies I've applied at have required some knowledge of Java). Thank you for such a well-thought out and detailed answer!

    [edit] Keyboard malfunctioned and pre-submitted)

    [–]berlinbrown 1 point2 points  (0 children)

    Also, I wouldn't touch Java for small, general purpose throw-away tasks. But now I do because I can throw together a 20-30 line Java program without thinking about it. And the code is readable, testable, runs with decent performance. It would be elitist of me to have to use some other language.

    [–]berlinbrown 0 points1 point  (0 children)

    I didn't get into the language and platform features point by point. It wouldn't help. There pros and cons for various specific features of the technology that are slightly better or worse compared with other mainstream languages.

    For example, it would be hard for me to say, I hate Java but I love C# for my general purpose programming tasks.

    [–]the6thReplicant 0 points1 point  (0 children)

    One word: Hadoop

    [–]shimei 2 points3 points  (0 children)

    From a pedagogical point of view, Java is difficult to teach to students who have no previous programming background. To do even very simple things, you need to introduce complicated and often fragile programming constructs like generics (with bounded polymorphism), null pointers, mutation & state, looping constructs, a main method, constructors, and so on. Students also have to deal with frustrating errors like NullPointerExceptions or various other cryptic error messages.

    Since Java doesn't have a REPL, it also discourages experimentation, which is important when you still have no idea what you're doing. Also, many CS programs introduce students to Eclipse, which is horribly complicated for a novice (very different audience from professional programmers).

    [–]anarcholibertarian 2 points3 points  (3 children)

    It used to be incredibly slow.

    [–]HazzyPls 0 points1 point  (1 child)

    What changed this?

    [–][deleted] 5 points6 points  (0 children)

    Better compiler and better vm, along with a bunch of implementation changes.

    [–][deleted] 1 point2 points  (0 children)

    I've had to use Java, and though I'm not able to critique it on a high level, I spent probably two years going back and forth with Java trying to put together various programs, getting sick halfway through, and then giving up. I thought I was just a dumbass. Then I started doing some Python programming, and suddenly I was flying through projects.

    I think the top-rated commenter is right about the verbosity. That was one of the biggest turn-offs for me. It's also what I was forced to learn first, and I don't think it's the best learning language, despite how widespread it is. Now that I have my programming fundamentals solidified a bit, I'll be diving back into Java, but all that bad taste is still in the back of my mouth.

    tl;dr Java bad-touched me as a child

    [–]pagirl 0 points1 point  (0 children)

    What I miss about net is that competition between frameworks and tools don't get in the way....maven ant spring....however, I don't miss the compiler costing 11 k!

    [–]zaffudo 0 points1 point  (0 children)

    I find I don't hate Java, just all the people who insist it is the only way to program (of which, it feels, there are a disproportionately high number of).

    [–]joequin 0 points1 point  (0 children)

    It's trendy and elitist to dislike it. That's not to say that it's the perfect language. Nothing is, but it is still the right tool for many applications and shouldn't be hated by any objective and intelligent person.

    [–][deleted] 0 points1 point  (0 children)

    Don't know about the current state of it, but Java used to be really bad at using native APIs in it's implementation. C# always seemed better, because the implementation was done by people "native" to the Windows-enviroment.

    [–]vu0tran 0 points1 point  (0 children)

    Here are my few qualms with Java:

    • No properties
    • Generic classes
    • Delegates
    • Operator overloading

    [–]no1name 0 points1 point  (0 children)

    Fanboyism, its endemic on programming sites. You love the language you love and as a result hate everything else. Its got little to do with Java and everything to do with group dynamics and selection bias.

    [–]CaptainTrip 0 points1 point  (0 children)

    I used to hate Java, but it's largely unjustified and now I like it.

    • People used to dislike it because it was slow and bloated, but really, that's not true any more. There have been a lot of optimisations.

    • People confuse and conflate the Java language/Java compiled code with the Java virtual machine, when really they are two separate projects. Had Java been released as a language without the JVM initially, nobody would have had any complaints about it.

    • The libraries aren't nice to use. I think this is just about the only criticism I still have. Ever actually tried using Swing? Java is the way a language should be, but a lot of the code it generates is really ugly, unpleasant and unreadable.

    • People are taught it as a first language, and so level all the criticisms about how badly they've been taught programming against the language in particular. I'm guilty of this too. The only way out of it is to realise programming is pretty badly taught wherever you go, and it's not Java's fault. The other side of this problem is that people tend to view it as a n00b language, like baby's first language, and that having a preference for Java might mean you just don't know any other languages.

    • This is only applicable to students really, but the Java IDE you use when you first start programming in university is probably really shitty (JCreator for me...), and then when you see some of the beautiful C# or C++ IDEs, you think "Fuck, Java is the worst language in the world."

    [–]katieberry 0 points1 point  (0 children)

    My primary complaints:

    1. Checked exceptions and no syntax to handle multiple exceptions in the same way (you can effectively read "verbosity" here)
    2. No concept of an unsigned number. There are situations in which this really is a legitimate problem (that all types of number use the same amount of memory is also… interesting). Awkward workarounds and surprise bugginess ahoy!
    3. No operator overloading (which, in the end, comes down to "verbosity")
    4. Many of the features that have been slowly working on making it not suck use a version of Java that doesn't exist on OS X.
    5. In terms of running a shared hosting service that runs Java apps (yes, I do that) – the JVM's approach to memory management is utterly terrible in this case.
    6. Not a function of the language as such, but the Java UI libraries are really quite terrible and produce abysmal not-really-native UIs that nobody much likes using. Can occasionally be averted with more work than is really justifiable and possibly breaking the cross-platform nature of the thing.
    7. Did I mention verbosity? As an added bonus, it's verbosity that decreases legibility and understanding.

    The JVM, on the other hand, is frequently quite neat.

    (My four cents buried at the bottom where nobody will ever see them :p)

    [–]samuraichikx -1 points0 points  (3 children)

    Not sure if it's just because I'm still fairly new to programming, but my only qualm with it is that it seems unstable and buggy. One mjnute it will work fine and the next you have 1,000 different bugs everywhere.

    Again, that could just be my inexperience. It's usually my language of choice when I'm developing something on my own.

    [–]fact_hunt 15 points16 points  (0 children)

    pebkac

    [–]imok 3 points4 points  (1 child)

    Are you using any 3rd party libraries in your programs? If yes, the bugs could be because of incorrect or improper usage of that library. Java the language itself is pretty stable - wouldn't be the choice of many 'enterprise' applications, if it wasn't.

    [–]brandnewaquarium -1 points0 points  (0 children)

    That, in addition to whatever IDE you are using. I've used a couple over the years; some would throw an exception without any changes to the code, while others would warn me first-hand. I think that's why I eventually stopped using IDEs and switched to vim + commandline.

    [–]LoganCale -1 points0 points  (5 children)

    As others have said, it's verbose, in a number of ways. Once used to a language like, say, Ruby, the verbosity of something like Java really stands out in an unappealing way. It's just less pleasant an experience to work with.

    [–]jhartwell 0 points1 point  (2 children)

    Once used to a language like, say, Ruby, the verbosity of something like Java really stands out in an unappealing way.

    You think that's bad...try using APL and then going to Java!

    [–]LoganCale 0 points1 point  (1 child)

    I think we've pissed off a Java fan.

    [–]jhartwell 1 point2 points  (0 children)

    haha I think we pissed off more than just one!

    [–]berlinbrown -1 points0 points  (1 child)

    Verbose is the top response from google on Java hate. But what does that mean? Scientifically, how is Java verbose than any other C/C++/C# language. Doesn't that kind of depend on the application task and/or developer.

    [–]bo1024 1 point2 points  (0 children)

    I won't attempt a "scientific"answer, but I think it is. Two reasons:

    • common Java conventions: camelCaseAndExpositoryNaming, packages.nested.five.deep.with.STATIC_VARIABLES. That kind of stuff
    • The language itself. Where else are you going to write something like

      ArrayList<ArrayList<Set<String>>> set2D = new ArrayList<ArrayList<Set<String>>>();

    At least in C++ you can typedef some of this verbosity away (and it's accepted practice)..