Why must Java suck?

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
I haven't used C# myself but what I've seen I've liked. Nice syntactic concepts like properties (albeit, extremely verbose but better than (g/s)etters) and annotations.

The thing that keeps me loving java over .net is the open source community. With the notable exception of the base platform the java community is so far ahead of the .net community. I love that I can download and set up all the components of an enterprise class system in an afternoon at home for free. I also like that much of the innovation is driven by widely accepted open source projects, chosen for their quality, rather than simply swallowing an entire centrally designed system from the :evil: empire :p

Java-to-c++ comparisons are not really relevant imo because it's rare that you would actually consider either equally for a particular project, they have relatively different areas of strength. Of course, I've never been a c++ developer so that's just an opinion.
 

Deeko

Lifer
Jun 16, 2000
30,213
12
81
kamper...see I'm not a huge open source guy so...and as for the second part, you can't directly compare the two, no, but I could have done this particular assignment much quicker and more easily in C++.
 

Stuxnet

Diamond Member
Jun 16, 2005
8,392
1
0
Originally posted by: Deeko
jbourne,

Keep it coming. You're doing a good job of digging a hole even farther and farther.

Not paying attention in class? We weren't instructed on how to do this assignment. We are supposed to just do it based on what we know about OOP, and later we'll learn "better" ways of doing it. Wait till the last minute? If by that you mean I got stuck because a bridge was down, so I got back to school a half a day later than I was supposed to, then sure, I waited to the last minute. When you're supposed to have 15 hours to work on something you end up with about 3, you get a bit cramped for time, don't you think?

In the beginning, yes, I was just ranting. I asked questions LATER IN THE THREAD. You're STILL proving that the sand is just grating your vagina and preventing your ability to read the rest of the thread. Seriously, take a shower, it will come right out.

Did you also miss the part WHERE MY PROFESSOR DOESNT KNOW JAVA EITHER? That kinda throws another wrench into your whole "listen in class next time" argument, now doesn't it?

You have to paths jbourne....take a shower, get that sand out of there, become a productive member of society, or keep whining and bitching that I insulted your perfect language. Whatever floats your illiterate boat.


You're a riot, kid ;) . The vagina references really make me want to take you seriously. Really, they do ;) .

Speaking of "reading the whole thread", I never said Java was the perfect language. It has its place, just like the others. That's what people were trying to tell you.

Originally posted by: kamper
I haven't used C# myself but what I've seen I've liked. Nice syntactic concepts like properties (albeit, extremely verbose but better than (g/s)etters) and annotations.

The thing that keeps me loving java over .net is the open source community. With the notable exception of the base platform the java community is so far ahead of the .net community. I love that I can download and set up all the components of an enterprise class system in an afternoon at home for free. I also like that much of the innovation is driven by widely accepted open source projects, chosen for their quality, rather than simply swallowing an entire centrally designed system from the :evil: empire :p

Java-to-c++ comparisons are not really relevant imo because it's rare that you would actually consider either equally for a particular project, they have relatively different areas of strength. Of course, I've never been a c++ developer so that's just an opinion.

I couldn't agree more. I think .NET has some pretty good advantages over Java while Java certainly has some over .NET. In the end it really just depends on what the client needs. I'm actually going to be resigning tomorrow to go work for a previous boss of mine, and their whole shop is .NET. In their given situation, it's the ideal solution. However, .NET just wouldn't make sense in my current position. This is actually another reason why I'm making the change... I just need a change of pace, but I'll definitely miss Java. One thing that does really bother me about C# is the lack of checked exceptions. I'm not too crazy about that...
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: jbourne77
One thing that does really bother me about C# is the lack of checked exceptions. I'm not too crazy about that...
Seriously? The compiler doesn't force you to catch any class of exception? I'm not down with that at all :thumbsdown:
 

Stuxnet

Diamond Member
Jun 16, 2005
8,392
1
0
Originally posted by: kamper
Originally posted by: jbourne77
One thing that does really bother me about C# is the lack of checked exceptions. I'm not too crazy about that...
Seriously? The compiler doesn't force you to catch any class of exception? I'm not down with that at all :thumbsdown:

Nope... In fact, they did an interview with the lead architect, Anders Heljsberg, and he said the decision was based on versioning issues. For example, in Java, let's say you deploy A.class and B.class, and B uses a method in A that throws FileNotFoundException and IOException. Well, you write an update to that same method in A, and now it throws those two previous exceptions plus a NumberFormatException. Well, because the exceptions are checked and B doesn't catch or throw the NFE, you've broken the app.

While I see his point, I also recognize that regardless of whether or not the exceptions are checked, you've busted the app in most cases by introducing behavior that is unexpected by B. Granted, without checked exceptions, the app will at least run, but it will likely act quite unpredictably.

Also understand where Microsoft's motivation lies. They're trying to put to death the DLL Hell that we've all come to know and love. While I think Anders's argument is sound, even though I may not agree with it, I think the true goal was to structure .NET in such a manner that you can take a given distributatable and as long as the function signatures are the same, you won't have any problems with versioning.

Instead, you just have quirky application behavior ;) .

I'll admit that in Java, I use checked exceptions as a bit of a crutch... but I also take a very different approach to exception handling than Anders apparently does. Personally, I tend to write a lot of handling code, as I do try to account for every exception that could pop up and recover from it as gracefully as possible. One of Anders's reasons behind taking his approach was that most programmers just throw Exception all the way up the stack to short-circuit the whole mechanism. His stance, IIRC, was "why bother them with this if they're just going to circumvent it". I guess I just don't think that shoddy programming practices are a reason to abandon what would otherwise be a very helpful tool to developing tight, intuitive, and graceful applications.
 

Deeko

Lifer
Jun 16, 2000
30,213
12
81
jbourne, if you would just take a shower and be done with it, you'd have a much better day.

I have no problems with the compiler not FORCING you to catch an exception. If it needs to be caught, I'll catch it.
 

statik213

Golden Member
Oct 31, 2004
1,654
0
0
Originally posted by: akubi
eclipse and netbeans are free. try eclipse first...

Give Borland JBuilder a try as well, the foundation edition is free (for commericial use as well). I've used visual studio .net for my c++ stuff and I liked some of the features in JBuilder coming from vs.net, notably - refactoring. I love the way you can rename a method and jbuilder updates every reference to it (incl. overloaded methods in child classes).
I haven't tried eclipse or netbeans, so I can't compare.
 

Stuxnet

Diamond Member
Jun 16, 2005
8,392
1
0
Originally posted by: Deeko
If it needs to be caught, I'll catch it.


Ahh... the same arrogance that was in your first post. Good stuff, Scooter ;) .

Let me guess... you never write bugs, either?

Idiot
 

znaps

Senior member
Jan 15, 2004
414
0
0
Originally posted by: statik213
Originally posted by: akubi
eclipse and netbeans are free. try eclipse first...

Give Borland JBuilder a try as well, the foundation edition is free (for commericial use as well). I've used visual studio .net for my c++ stuff and I liked some of the features in JBuilder coming from vs.net, notably - refactoring. I love the way you can rename a method and jbuilder updates every reference to it (incl. overloaded methods in child classes).
I haven't tried eclipse or netbeans, so I can't compare.

Eclipse has excellent refactoring, Netbeans has some but not as good.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: jbourne77
Nope... In fact, they did an interview with the lead architect, Anders Heljsberg, and he said the decision was based on versioning issues. For example, in Java, let's say you deploy A.class and B.class, and B uses a method in A that throws FileNotFoundException and IOException. Well, you write an update to that same method in A, and now it throws those two previous exceptions plus a NumberFormatException. Well, because the exceptions are checked and B doesn't catch or throw the NFE, you've broken the app.

While I see his point, I also recognize that regardless of whether or not the exceptions are checked, you've busted the app in most cases by introducing behavior that is unexpected by B. Granted, without checked exceptions, the app will at least run, but it will likely act quite unpredictably.

Also understand where Microsoft's motivation lies. They're trying to put to death the DLL Hell that we've all come to know and love. While I think Anders's argument is sound, even though I may not agree with it, I think the true goal was to structure .NET in such a manner that you can take a given distributatable and as long as the function signatures are the same, you won't have any problems with versioning.

Instead, you just have quirky application behavior ;) .

I'll admit that in Java, I use checked exceptions as a bit of a crutch... but I also take a very different approach to exception handling than Anders apparently does. Personally, I tend to write a lot of handling code, as I do try to account for every exception that could pop up and recover from it as gracefully as possible. One of Anders's reasons behind taking his approach was that most programmers just throw Exception all the way up the stack to short-circuit the whole mechanism. His stance, IIRC, was "why bother them with this if they're just going to circumvent it". I guess I just don't think that shoddy programming practices are a reason to abandon what would otherwise be a very helpful tool to developing tight, intuitive, and graceful applications.
I think the changing method signature bit is a load of crap. The throws clause is part of the signature every bit as much as the parameters or return type and changing it should break the method. I think having all exceptions unchecked would lead to too many lazy programmers putting catch (Exception) blocks in when they really don't mean to trap everything.
 

Deeko

Lifer
Jun 16, 2000
30,213
12
81
Originally posted by: jbourne77
Originally posted by: Deeko
If it needs to be caught, I'll catch it.


Ahh... the same arrogance that was in your first post. Good stuff, Scooter ;) .

Let me guess... you never write bugs, either?

Idiot

Listen Sandy, of course I write bugs, but I test and find them.

You're still a whiney little dork who can't read, won't read, got proved wrong again and again, thought he'd try to redeem himself by being long winded and somewhat intelligent in a reply to someone else, but still hasn't picked himself up after falling on his face earlier in the thread.

You clearly suck at most things in life. At least you've got java going for you.
 

Stuxnet

Diamond Member
Jun 16, 2005
8,392
1
0
Wow... so much hate and hostility. You should get back to your books, Tiger, and let the professionals talk.

Good luck in the real world, Champ ;) .
 

Stuxnet

Diamond Member
Jun 16, 2005
8,392
1
0
Originally posted by: kamper
I think the changing method signature bit is a load of crap. The throws clause is part of the signature every bit as much as the parameters or return type and changing it should break the method. I think having all exceptions unchecked would lead to too many lazy programmers putting catch (Exception) blocks in when they really don't mean to trap everything.

Well, that's just it: there is no throws clause in C#. So, technically, even though you might add the possibility of function abc() throwing an exception, the signature itself doesn't change... so TECHNICALLY, you've not broken compatibility with any objects calling that function.

It's just a different style I guess... I'm not as experienced with C# as I am with Java, so I haven't really formed an opinion yet; but my gut tells me that somewhere between the strict exception handling of Java and the free-for-all of C# lies the truth. It does surprise me, however, that a language that boasts so much of typesafety that it would take the route of unchecked exceptions.

 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: Deeko
Originally posted by: jbourne77
Originally posted by: Deeko
If it needs to be caught, I'll catch it.


Ahh... the same arrogance that was in your first post. Good stuff, Scooter ;) .

Let me guess... you never write bugs, either?

Idiot

Listen Sandy, of course I write bugs, but I test and find them.

You're still a whiney little dork who can't read, won't read, got proved wrong again and again, thought he'd try to redeem himself by being long winded and somewhat intelligent in a reply to someone else, but still hasn't picked himself up after falling on his face earlier in the thread.

You clearly suck at most things in life. At least you've got java going for you.

At least he has something intelligent to add to the conversation, unlike your childish replies to his "trolling"
 

Deeko

Lifer
Jun 16, 2000
30,213
12
81
Originally posted by: MCrusty
Originally posted by: Deeko
Originally posted by: jbourne77
Originally posted by: Deeko
If it needs to be caught, I'll catch it.


Ahh... the same arrogance that was in your first post. Good stuff, Scooter ;) .

Let me guess... you never write bugs, either?

Idiot

Listen Sandy, of course I write bugs, but I test and find them.

You're still a whiney little dork who can't read, won't read, got proved wrong again and again, thought he'd try to redeem himself by being long winded and somewhat intelligent in a reply to someone else, but still hasn't picked himself up after falling on his face earlier in the thread.

You clearly suck at most things in life. At least you've got java going for you.

At least he has something intelligent to add to the conversation, unlike your childish replies to his "trolling"

His side conversation has nothing to do with the actual thread discussion, which was about c++ being better for my assignment than java. Until he started chatting with someone else, he had NOTHING intellgent to add.

jbourne, funny, my co-op employers are all actively trying to recruit me for when I graduate, and I still have two years left. Good thing I should just let the professionals talk though, right? Have you taken that shower yet?
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: jbourne77
Originally posted by: kamper
I think the changing method signature bit is a load of crap. The throws clause is part of the signature every bit as much as the parameters or return type and changing it should break the method. I think having all exceptions unchecked would lead to too many lazy programmers putting catch (Exception) blocks in when they really don't mean to trap everything.

Well, that's just it: there is no throws clause in C#. So, technically, even though you might add the possibility of function abc() throwing an exception, the signature itself doesn't change... so TECHNICALLY, you've not broken compatibility with any objects calling that function.
Well I guess that depends on your definition of compatibilty. Personally, I want to know if an api changes on me to the degree that it throws a whole new exception. It's nice to have the compiler, or the run time environment as a fallback, check that for me.
It's just a different style I guess... I'm not as experienced with C# as I am with Java, so I haven't really formed an opinion yet; but my gut tells me that somewhere between the strict exception handling of Java and the free-for-all of C# lies the truth. It does surprise me, however, that a language that boasts so much of typesafety that it would take the route of unchecked exceptions.
That's just it. I can live with unchecked exceptions running wild, but then I want to be in the mentality of a loosely typed language, and I won't be using c# for that.

That actually makes me wonder if the multi language support in .NET is part of the reason. If you get something like IronPython code running on your CLR you obviously aren't going to be declaring all your exceptions (from what I understand of Python) so maybe it's just not possible to keep track along the language barriers?
 

randumb

Platinum Member
Mar 27, 2003
2,324
0
0
If you want to learn Java, I'd recommend picking up some books on Java design patterns and such, since your professor obviously sucks at Java. Thinking in Java by Bruce Eckels is available for free online, and is geared towards C++ programmers and even though it is an introductory book, it moves pretty quickly through the basics and covers a lot of more complex concepts. The Effective Java Programming Language Guide by Joshua Bloch is full of a bunch of useful Java tips and examples of how to solve problems the Java way.
 

Stuxnet

Diamond Member
Jun 16, 2005
8,392
1
0
Originally posted by: kamper
<snip>

Yeah, I really couldn't agree more. I won't pretend to understand how exactly the CLR works, but I imagine that checked exceptions may have been a stumbling block for the reasons you described.

I also agree that if an API changes such that new exceptions are introduced to a given method, then compatibility has already likely been broken. Quite frankly, I'd prefer the app not run AT ALL than to have it run with totally arbitrary results.

Originally posted by: Deeko
Until he started chatting with someone else, he had NOTHING intellgent to add.

Yeah, because saying "java sucks" and "java is awful" with no real Java background is just BRILLIANT!

And Technically, the actual thread was about java "sucking" and it being "awful". I just chose to call you out on that... it's not my fault you took it so personally. Sorry, but the OP was unreasonable. While your reasoning may have been quite legitimate, you introduced it in a pretty piss-poor manner and it took some time for you to get focused... and you got a few flames for it. Get over it, Junior.

God help you when a coworker challenges your ignorant statements in the workplace... If one of my teammembers reacted like that, I'd can him. Of course, I probably wouldn't have hired him in the first place. I really don't have room for people who slam and bash technologies they know nothing about.
 

Deeko

Lifer
Jun 16, 2000
30,213
12
81
Allow me to quote myself. The OP mind you.

Doing an assignment for my OOP class that must be done in Java.

It would be so much easier in C++.

Java is awful.

First line - you can't complain. Background on the problem.
Second line - simply a fact.
Third line - deduced from line two. In my case, Java is awful.

You are the one that took things personally my sandy friend. You took that post and blew it WAY out of proportion.

As for in the work force....I'm not sure if this occured to you or not, but this is Anandtech. Now, correct me if I'm wrong, but I don't believe I work at Anandtech, do I? There's this magical little ability to behave differently on an online forum full of easily-insulted whiney dorks like you and in the workforce. Amazing, huh?
 

imported_BikeDude

Senior member
May 12, 2004
357
1
0
Originally posted by: jbourne77
While I see his point, I also recognize that regardless of whether or not the exceptions are checked, you've busted the app in most cases by introducing behavior that is unexpected by B. Granted, without checked exceptions, the app will at least run, but it will likely act quite unpredictably.

Not necessarily. In my experience you rarely care for specific exceptions. Most exceptions will halt whatever operation is currently taking place, and those specific that you care about you typically handle as needed.

And I doubt DLLs has much to do with this. Consider Anders' background (one of the lead designers of Borland Delphi) and I think you'll find DLL-hell doesn't factor into this. If you use a third-party library (in Delphi they usually come with full source), it should be reasonably simple to update said library without breaking your own code. If your code has to know about every exception thrown by methods in that library, then something is awry. (The developer will be punished each and every time the libraries are updated)

My guess is that checked exceptions makes it difficult to develop large Java projects.

Bottom line though: I can't help but notice that our competitors who use Java, they staff more people, incur bigger downloads, use more disk space (OK, not really important any more), burn more memory, use more CPU and... Their products look like crippled versions of our software (feature wise).

It is very hard (impossible) to beat Borland Delphi if your target is 32-bit Windows and you have any sort of GUI in your app. And for many apps it provides an easy entry into .net as well. (as well as x86 Linux) Its aging compiler is only on par with VC++ 2.0 or so optimization-wise, but compared to Java the result flies... (plus the compiler speed is insanely fast)
 

jman19

Lifer
Nov 3, 2000
11,225
664
126
Originally posted by: Deeko
Allow me to quote myself. The OP mind you.

Doing an assignment for my OOP class that must be done in Java.

It would be so much easier in C++.

Java is awful.

First line - you can't complain. Background on the problem.
Second line - simply a fact.
Third line - deduced from line two. In my case, Java is awful.

You are the one that took things personally my sandy friend. You took that post and blew it WAY out of proportion.

As for in the work force....I'm not sure if this occured to you or not, but this is Anandtech. Now, correct me if I'm wrong, but I don't believe I work at Anandtech, do I? There's this magical little ability to behave differently on an online forum full of easily-insulted whiney dorks like you and in the workforce. Amazing, huh?

Line 3 doesn't necessarily follow from line two. You basically came in this thread throwing around a blanket statement that "Java sucks." You should expect to get flamed for a comment like that.
 

RedCOMET

Platinum Member
Jul 8, 2002
2,836
0
0
While not reading most of the threads posted, i think that java doesn't suck. I know i suck at programming in java for my java class, but that doesn't mean the language as a whole is terrible.

I do however think that the OP sucks for thinking java sucks ;).

J/K: i've worked my ass off on some java assignments and it fought me every chance it could get and then some. But i did the best that i could.
 

Stuxnet

Diamond Member
Jun 16, 2005
8,392
1
0
Originally posted by: Deeko
Allow me to quote myself. The OP mind you.

Doing an assignment for my OOP class that must be done in Java.

It would be so much easier in C++.

Java is awful.

First line - you can't complain. Background on the problem.
Second line - simply a fact.
Third line - deduced from line two. In my case, Java is awful.

Yikes... I hope you can muster up better reasoning skills when you're programming...

Originally posted by: Deeko
As for in the work force....I'm not sure if this occured to you or not, but this is Anandtech. Now, correct me if I'm wrong, but I don't believe I work at Anandtech, do I? There's this magical little ability to behave differently on an online forum full of easily-insulted whiney dorks like you and in the workforce. Amazing, huh?

Ahh... so you must be one of those people who were targeted by the "Sh*tc*ck" cartoon ;) . Gotchya ;) .

You see, there's this thing called "character". It's what you do when no one's looking. We obviously know what you're capable of when no one is "looking". But I guess that's your problem, not ours, Booster.

Anyway...

Originally posted by: BikeDude
And I doubt DLLs has much to do with this. Consider Anders' background (one of the lead designers of Borland Delphi) and I think you'll find DLL-hell doesn't factor into this.

I don't know that it factored in directly, but I do suspect it played a part because they (Microsoft) wanted to minimize versioning problems as much as possible, which unchecked exceptions does in a round-about way.

Originally posted by: BikeDude
My guess is that checked exceptions makes it difficult to develop large Java projects.

It's difficult to say. It certainly does require good planning, otherwise scalability can become an issue... I've seen good and bad come of it, which is why I'm not sure what my opinion is yet. I'll need more production experience with C# before I'm really qualified to form an iron-clad opinion on the matter. Until then, my viewpoint is biased toward checked exceptions, which is why I need to make an effort to keep an open mind. I read Anders comments on it every now and then just to get myself thinking about it again. Regardless of which is right or wrong, it does make for interesting debate because there are merits to both sides.

Originally posted by: BikeDude
Bottom line though: I can't help but notice that our competitors who use Java, they staff more people, incur bigger downloads, use more disk space (OK, not really important any more), burn more memory, use more CPU and... Their products look like crippled versions of our software (feature wise).

I'm surprised about the bigger downloads... I've found that Java apps typically have a much smaller footprint, but like you said, in this day and age it's not factor. I can see it taking more memory and CPU. While I enjoy working with Swing, I don't think Java is the best solution for a windows application if portability isn't a concern. There's no question that it takes a more advanced Java developer to make application XYZ exhibit a given performance level, while in .NET it doesn't require the same amount of work. I would never use Java to write an application that is only be deployed to Microsoft Windows... there are clearly better candidates. But if cross-platform is your goal, you CAN write the app in Java to exhibit the same performance as, say, .NET... but it's going to take more work and there's less room for thread/resource mismanagement.

Originally posted by: BikeDude
It is very hard (impossible) to beat Borland Delphi if your target is 32-bit Windows and you have any sort of GUI in your app. And for many apps it provides an easy entry into .net as well. (as well as x86 Linux) Its aging compiler is only on par with VC++ 2.0 or so optimization-wise, but compared to Java the result flies... (plus the compiler speed is insanely fast)

I've actually not tried Delphi... I'll take a look at it if/when I get the chance.


Sorry about the long post.
 

znaps

Senior member
Jan 15, 2004
414
0
0
A lot of the newer J2EE frameworks are moving away from checked exceptions. Spring for example rethrows all those JDBC related exceptions as unchecked Spring exceptions. So the trend in Java is similar to C#.