Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Reasons to hate Java

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Reasons to hate Java
ReyBrujo
Moderator
January 2001
avatar

Quote:

That's stupid. I seriously hope that the "research" topic isn't set by the teacher.

The teacher may have asked to find pro and contras of Java, and he may have already found all the good points ;)

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Goalie Ca
Member #2,579
July 2002
avatar

Maybe these problems were fixed in a newer java (than 1.4) but i'll list em all here:
(hopefully i remembered them all its been a while since i've touched it ~ 2 years)

Swing, Awt, SWT = each awful in their own way
Java's container classes = pain in the ass to work with, especially with ints, floats, doubles, etc.
Lack of an unsigned type
Try and catch but no finally
String class is a pita sometimes.
Garbage collection needs to be smartened up/controllable
Templates (i realize it has generics but from what i understand they're still very restrictive, do they have template specialization for example?)

Other than that my other complaints with java is that we had to code apps which would have been best done in c++ in java for class so its not really java's fault.

All in all i like java but i like c# more. C# libs suck and the resource handling in .NET runtime is disgusting.

-------------
Bah weep granah weep nini bong!

HoHo
Member #4,534
April 2004
avatar

IMO containers are almost fixed and are a bit similar to C++ STL now

Quote:

Try and catch but no finally

huh? I've used it quite a bit

try {
  blah;
} catch (Exception e) {
  e.printStackTrace();
} finally{
  bleh;
}

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

Crazy Photon
Member #2,588
July 2002
avatar

Quote:

do they have template specialization for example?

I think it does ;)

-----
Resistance is NEVER futile...

spellcaster
Member #1,493
September 2001
avatar

On a sidenote:
Have a look at Titan Attakcs. Titan Attacks is a great (Java) game, selling well, playing better and they have quite some other goodies on their page as well.

After playing around a bit with the current java gaming libs, I must say that I am really impressed.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Goalie Ca
Member #2,579
July 2002
avatar

Quote:

try {
blah;
} catch (Exception e) {
e.printStackTrace();
} finally{
bleh;
}

Yay. Time for me to go shoot some CS TA's and profs in the face :P
Then again when they didn't realize it had "protected" at least then i knew not to believe them.

-------------
Bah weep granah weep nini bong!

X-G
Member #856
December 2000
avatar

Ooh! Ooh! I know a great reason! They force us to use it in our Algorithms course. :P

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

kentl
Member #2,905
November 2002

Quote:

Yay. Time for me to go shoot some CS TA's and profs in the face :P
Then again when they didn't realize it had "protected" at least then i knew not to believe them.

Seems like you go to a crappy school, you should switch.

Carrus85
Member #2,633
August 2002
avatar

Goalie Ca said:

Java's container classes = pain in the ass to work with, especially with ints, floats, doubles, etc.

A lot of the hastle with this was fixed with the introduction of autoboxing in Java 1.5.

So, before java 1.5, you would have to do this:

int i = 5;
Integer j = new Integer(10);
i = j.valueOf();

From 1.5 and beyond, you can do this instead:

int i = 5;
Integer j = 10;
i = j;

Additionally, just for those who haven't used java since 1.4, they have added some other "nice" features, such as a for-each loop mechanism, support for variable argument functions, language-level support for enumerations, static imports (for better or for worse), as well as a several additional classes ( such as java.util.concurrent.locks.* for locking specific "chunks" of code instead of entire methods).

Goalie Ca
Member #2,579
July 2002
avatar

Quote:

Seems like you go to a crappy school, you should switch.

I'm in engineering :D I only took those 5 or 6 cs classes cuz i had to. luckily that stuff is now behind me :D

@ carrus85:
Autoboxing is nice, but i hope that all the generic container classes come with template support. I cannot undestand why they didn't just make a vector for int, double, float, byte, char, and object rather than just object in the past.

As for the rest of the features its starting to sound nicer. I never did work with java threading but concurrent.locks sounds a lot like the functionality provided by a simple mutex. Of course its gonna have full language support but, if i understand correctly, it makes no sense for java to have waited this long to add that simple capability.

It's like c# came along and sun decided, hey we could actually make this language useful.

-------------
Bah weep granah weep nini bong!

HoHo
Member #4,534
April 2004
avatar

Quote:

as well as a several additional classes

Of those atomic primitives are my favorites because they just make concurrent programming so much simpler. No need for any locks or mutexes or synchronized functions/blocks :)

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

Carrus85
Member #2,633
August 2002
avatar

Well, AFAIK, all of the container classes now use their "generics" implementation (true, generics aren't as "uberpowerful" as c++ templates, but they are nice in their own right.)

To quote the java documentation:

Quote:

Three new language features significantly enhance the collections framework:

* Generics - adds compile-time type safety to the collections framework and eliminates the need to cast when reading elements from collections.
* Enhanced for loop - eliminates the need for explicit iterators when interating over collections.
* Autoboxing/unboxing - automatically converts primitives (such as int) to wrapper classes (such as Integer) when inserting them into collections, and converts wrapper class instances to primitives when reading from collections.

In short, all of the classes have been retrofitted to use generics instead of objects. True, this means that you are still putting an object into the container (all generics arguments must be classes), but the conversion is a significant degree more transparent than it has been in the past.

Goalie Ca
Member #2,579
July 2002
avatar

Hmm, generics can only be objects but it does avoid blind casting and casting exceptions i suppose.

I remembered 1 last thing about java that i found annoying. There's System.out.println but no System.in.readline afaik. Would have to instantiated buffered reader etc. every time.

-------------
Bah weep granah weep nini bong!

Carrus85
Member #2,633
August 2002
avatar

Java 1.5 introduces a class that handles just that very nicely.

1import java.util.Scanner;
2 
3/* code */
4Scanner input = new Scanner(System.in);
5//Then you can do this:
6String s = input.next();
7String s = input.nextLine();
8Integer i = input.nextInt();
9Double i = input.nextDouble();
10// etc.
11 
12// You can also inspect the input buffer
13if ( input.hasNext() ) { ... };
14if ( input.hasNextLine() ) { ... };
15// etc.

If the lack of a System.in.readline really bothers you, you can always just create a static public member variable, call it stdin, and use it...

Marcello
Member #1,860
January 2002
avatar

Quote:

Garbage collection needs to be smartened up/controllable

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/package-summary.html

Marcello

Bruce Perry
Member #270
April 2000

A reason to hate Java:

Hashtable ht = new Hashtable();
Vector v = new Vector();
ht.put(v, blah);
v.addElement(whee);
blah = ht.get(v);

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Indeterminatus
Member #737
November 2000
avatar

Quote:

do they have template specialization for example?

You shouldn't do that anyway.

I have nothing against Java, but I have something against extremist groups being either Java haters or Java lovers without any valid ground of reasoning. It has been said before, and I'll repeat it whole-heartedly: the right tool for the right job. Java has its applications, and if they fit your requirements, go with it. If not, look for something different that suits you better.

_______________________________
Indeterminatus. [Atomic Butcher]
si tacuisses, philosophus mansisses

nonnus29
Member #2,606
August 2002
avatar

Wow, I have absolutely nothing to add to this thread except; use the best tool for the job.

kazzmir
Member #1,786
December 2001
avatar

Sorta skipped most of this thread.. but:

To the people who claim Java is slow, you obviously dont know the difference between a language and the thing that executes it. The JVM you happen to use might suck, but thats not really Java's fault. C used to be slow too..

Anyway my main complaints about Java are

  • Once you get into the Java mentality of design its extremely easy to over-engineer everything. Like ML said you end up having or using classes that abstract away virtually nothing until you have a lot of structure without a lot of purpose.


  • Garbage collection. Sometimes I love it, sometimes I hate it but its worth complaining about. When you really want to get rid of some memory the best you can do is Runtime.gc() or whatever the call is and pray to god the JVM will run the garbage collector for you. Sometimes praying just doesnt cut it.


  • The classpath swapped dll hell for basically configuration hell. If you accidentally put the wrong version of a jar in the front of your classpath you will have all sorts of wierd problems that take a good while to debug. 9/10 of all my problems in Java are classpath related.


  • Anonymous inner classes are the poor man's lambda. Ive heard people say lambda are a poor man's anonymous inner classes too, but I think thats malarky. When you want to pass around a function wouldn't you rather do this

scheme:
(some_function (lambda (arg1) (printf arg1)) (list 1 2 3))
or ruby:
some_function( lambda{|x| puts x}, [1,2,3] )

Instead of this:

list = new List();
list.add( new Integer( 1 ) );
list.add( new Integer( 2 ) );
list.add( new Integer( 3 ) );
some_function( new Lambda0(){
      public void execute( Object o ){
            System.out.println( o.toString() );
      }, list );

Maybe the example isnt long enough to be really dramatic but anonymous inner classes just dont cut it, IMO.

BAF
Member #2,981
December 2002
avatar

Why do I hate java? Because the people representing it in #java on efnet are total @sshats.

nonnus29
Member #2,606
August 2002
avatar

Quote:

#java on efnet are total @sshats

Heh, I've heard about that. Apparently they hate 'babying the newbies' or something and they'll eject people that do.

Rash
Member #2,374
May 2002
avatar

How about when your computer locks up before you realize it's because you went to that particular website?

m c
Member #5,337
December 2004
avatar

Yeah; this has ahppened to me all the time.

Though again; no fault of the language just it's particular implementation.

Reason to hate java:

A lot of people go on about how good it is, but i don't see anythign special. Normal yes, but not special, therefore i hate it in order to sustain the natural balance between the computer languages :)

Plus if you want a high level langue, you may as well have the most capable.

C can use fortran's or pascal's .oes, yet neither fortran nor pascal can use c's .oes, therefore C is more elite. Plus fortran and pascal have their crucial libraries written in C (in modern times atleast).

But assembler is not cross-platform, so it's too low-level to count. Java is another language that at some level is "derived" from c, so is c++ so is C# (even if self-hosted they are still derived languages, think about it).

So hate it to be an elitest prick, justifying it on the fact that there is this langauge called C and it is more cool.

(C is an exception to the natural order rule, as it is at the top of the food chain as explained above).

C is holier than thou, java. :-X So taketh the backseat that thou deserveth and feel thy hate! (or whatever)

(\ /)
(O.o)
(> <)

thematrixeatsyou
Member #6,183
September 2005
avatar

The main reason why I hate Java is that it freezes your PC while it is loading. Well, at least Firefox (Internet Exploiter too).

good food is t3h pwn <-- if anyone can find out how old this sig is they win an ascii penguin

Evert
Member #794
November 2000
avatar

Quote:

To the people who claim Java is slow, you obviously dont know the difference between a language and the thing that executes it. The JVM you happen to use might suck, but thats not really Java's fault.

From an end-user perspective, I beg to differ. I mean it, I've never seen a Java-based GUI application that ran at something approaching a decent speed, on any computer I've ran them on.

 1   2   3 


Go to: