As a research for university i'm looking for some reasons to hate java; post freely.
P.S. Please don't waste your time posting about how good Java is, this is NOT a language war and i'm not trying to prove to the world that Java sucks
1) You need to install proprietary software before you can use it.
Isn't that about the only solid reason?
Java is not open source (EDIT: depending on your point of view, this may not be necessarily a bad thing)
1) You need to install proprietary software before you can use it.
Install, yes. Propertiary no
Isn't that about the only solid reason?
Well, people hate things for various reasons. Some are just fanboys, some don't know about the subject and/or have prejudices.
Some might hate it because it runs in a VM but usually those people just don't know how far has Java developed from the 1.0/1.1 to 1.5. Speed difference is around 100x or more on average case. Usually those people also don't know what Java is good for.
Some might hate Java just because it has "J" in it's name
[edit]
Java is not open source (EDIT: depending on your point of view, this may not be necessarily a bad thing)
It is not OSS in it's general meaning but you can download the source, compile and modify it yourself if you want to. I don't think you can fork from the original Java or use their code in your own projects though.
It lies to you. "Write once run anywhere" my achin' ass...
Umm... I don't like coffee...
[edit]
I'm sorry, sometimes I feel compelled to reply to threads even if I don't have anything constructive to say.
Well, this is not directly a language issue, but I absolutely hate the java way of using braces. E.g.
void method(bool foo){ while(foo){ // Do many lines of nasty stuff } }
instead of proper BSD braces style:
void method(bool foo) { while(foo) { // Do many lines of nasty stuff } }
It makes a hell out of finding the matching brace and a code with many levels of indentation becomes very hard to read.
All of the above is of course IMHO.
EDIT: fixed the name of the braces style
At least you can have the IDE format the code the way you want
nstead of proper K&R braces style:
K&R style has braces on the same line.
You're talking about the BSD style, I guess - or another style with a similar braces style...
Install, yes. Propertiary no
Doesn't that still use software provided by Sun?
Well, people hate things for various reasons.
That's why I put emphasis on solid. "Because it runs in a VM" is not a very solid reason at all.
Well, this is not directly a language issue, but I absolutely hate the java way of using braces.
That's the 'java way'?
I don't like that method much either, but I have seen that style used in C, C++, PHP, C#, and others many times.
OOOPS, sorry I meaned the opposite. Wonder how I mixed them like that...
Yes, java coders often use the `K&R' style and I was refering to `BSD' or `Allman' style.
EDIT: fixed the offending post
Yay, flaming about Java and indentation in one thread
Personally I'm K&R conventions all the way.
Are you sure?
http://en.wikipedia.org/wiki/Indent_style#K.26R_style
Probably one of the best reasons so far was pointed by XG. You can throw platform independence out of the window as soon as you move from PC's or servers to embedded devices. There almost everyone have their own implementation of it and quite often they are not compatible.
[edit]
Doesn't that still use software provided by Sun?
Now that I read a bit more about I became confused. When I emerge it on Gentoo it gets compiled from source and I always thought it was OSS. It seems I was wrong.
http://en.wikipedia.org/wiki/Blackdown_Java
Blackdown Java is a port of Sun's Java virtual machine to Linux by a group of volunteers. It predates Sun's official Linux port. It still supports platforms the official version does not, including SPARC and PowerPC. Currently, Blackdown Java supports up to version 1.4.2 of the Java run-time libraries. Despite widespread confusion, Blackdown is neither Free Software nor Open Source.
Reasons to hate Java:
- because I'm stupid
Really, there is no other reason. To cite the Tao:
The Tao gave birth to machine language. Machine language gave birth to the assembler.
The assembler gave birth to the compiler. Now there are ten thousand languages.
Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.
But do not program in COBOL if you can avoid it.
If you think that the stupid thing is too harsh, then use this:
- because you don't know it
or maybe even
- because it's not what I use
but in all cases the one "hating" a language will look retarded.
but in all cases the one "hating" a language will look retarded.
Oh no, I assure you that you can "hate" COBOL and Fortran and get away with it every time.
Main reason to hate Java: Java applications almost always appear to run slower and look/feel differently than a native application, despite what Java supporters say.
Secondary reason: If you have a hacker mentality, then the strictness of Java can get in the way. However, that is normally a good thing...
But what I really dislike the most about Java is the mentality that seems to come with it: a program with the complexity of notepad has a 24 month timeline, complete with 400 pages of documentation that covers all 15,000 methods of the reusable KeyboardKeyBackSpace class.
My main complains:
Look & feel, Java applications go back to Windows 3.1 times, throwing achieved usability to the bin.
Encapsulation. You must put the definition inside your class declaration. That is like putting all the C++ source in the headers. It makes headers that should only show the interface painfully long.
Virtualization. It would be nice to have better support for virtualization, that would make programs much faster.
But what I really dislike the most about Java is the mentality that seems to come with it: a program with the complexity of notepad has a 24 month timeline, complete with 400 pages of documentation that covers all 15,000 methods of the reusable KeyboardKeyBackSpace class.
Really? 24 month timeline? Notepad could be written in one sitting, taking no more than three pages of code. I've done a web browser in less than half a page .
FMC: Does it have to be Java? There are plenty of ugly languages out there to pick on, like C++.
- You need to download 30MB of JRE.
- The generated bytecode is not obfuscated by default, all your code can be decompiled way too easily.
- It's VERY slow.
- Class names are inconsistent (Hastable, HashMap).
- Your code for version 1.4.1 won't run in 1.4.2.
a program with the complexity of notepad has a 24 month timeline, complete with 400 pages of documentation that covers all 15,000 methods of the reusable KeyboardKeyBackSpace class.
I wish I would have such assingments at work. I thik I could whip up a notepad-like thingie in half a day including learning GUI. Of cource I've also seen lots of people overusing class hierarcies and other things commonly used in Java.
Btw, have any of you heard of Brazil National Health Card Project?
linky
http://java.sun.com/javaone/sf/2005/sessions/general/scott_tuesday.jsp
From the time the first use case was specified to the time the information system was deployed, only four months had elapsed and 2.5 million lines of code were produced.
IIRC there were couple hundred people working on that project in parallel.
I don't need a reason to hate Java.
Storing your class system hierarchy inside a jar file/directory structure is ridiculous
- You need to download 30MB of JRE.
It's more like 13MB =P
- The generated bytecode is not obfuscated by default, all your code can be decompiled way too easily.
It gives you plenty of nice shit like reflection, though. If you're so paranoid, add yguard or proguard to your build process.
- It's VERY slow.
Oh come on.
- Class names are inconsistent (Hastable, HashMap).
Hashtable is from 1.1 days, they've since redone the entire collections system and all the new things are conformant (Hashtable is kept for legacy reasons).
- Your code for version 1.4.1 won't run in 1.4.2.
Mine will. Something wrong with your code?
My main gripe with Java is probably with Swing. Although I must say, in Java 1.6, it's a heck of a lot nicer.
Marcello
As a research for university i'm looking for some reasons to hate java; post freely.
That's stupid. I seriously hope that the "research" topic isn't set by the teacher. Also, a lot of the "drawbacks" people have listed above are plain wrong, mostly due to poor understanding so I wouldn't use anything from this thread in a "research" report.
One of the problems with Java is that they swept a bit too much of the innate complexity of life under the carpet of the libraries.
And so now they've had to replace the carpets several times.
-- Larry Wall - http://interviews.slashdot.org/interviews/02/09/06/1343222.shtml?tid=145
Java started with a "clean slate", but it was a rather undersized slate, methinks.
-- Larry Wall - http://interviews.slashdot.org/interviews/02/09/06/1343222.shtml?tid=145
As someone who has never written a line of Java code, my only problem with it is when I'm using a Java-based GUI application.
Despite what Java programmers claim, every Java-based GUI or GUI frontend that I've ever used was unbearably slow. When I have the option, I'll use a native compiled version, even if that means I get an ugly Motif GUI (as I do for Maple).
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
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.
IMO containers are almost fixed and are a bit similar to C++ STL now
Try and catch but no finally
huh? I've used it quite a bit
try { blah; } catch (Exception e) { e.printStackTrace(); } finally{ bleh; }
do they have template specialization for example?
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.
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
Then again when they didn't realize it had "protected" at least then i knew not to believe them.
Ooh! Ooh! I know a great reason! They force us to use it in our Algorithms course.
Yay. Time for me to go shoot some CS TA's and profs in the face
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.
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).
Seems like you go to a crappy school, you should switch.
I'm in engineering I only took those 5 or 6 cs classes cuz i had to. luckily that stuff is now behind me
@ 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.
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
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:
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.
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.
Java 1.5 introduces a class that handles just that very nicely.
1 | import java.util.Scanner; |
2 | |
3 | /* code */ |
4 | Scanner input = new Scanner(System.in); |
5 | //Then you can do this: |
6 | String s = input.next(); |
7 | String s = input.nextLine(); |
8 | Integer i = input.nextInt(); |
9 | Double i = input.nextDouble(); |
10 | // etc. |
11 | |
12 | // You can also inspect the input buffer |
13 | if ( input.hasNext() ) { ... }; |
14 | if ( 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...
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
A reason to hate Java:
Hashtable ht = new Hashtable(); Vector v = new Vector(); ht.put(v, blah); v.addElement(whee); blah = ht.get(v);
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.
Wow, I have absolutely nothing to add to this thread except; use the best tool for the job.
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
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.
Why do I hate java? Because the people representing it in #java on efnet are total @sshats.
#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.
How about when your computer locks up before you realize it's because you went to that particular website?
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. So taketh the backseat that thou deserveth and feel thy hate! (or whatever)
The main reason why I hate Java is that it freezes your PC while it is loading. Well, at least Firefox (Internet Exploiter too).
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.
About that stupid speed argument, let's just put it this way. Because of practical reasons java just isn't able to compete with c/c++ in all areas. It's language architecture obviously has some limits to it otherwise it'd be done by now. It doesn't matter what p = np is or all that other crud they teach us naive students
well, as long as games like Titan Attacks are possible in java, it's fast enough for me
And if you have some parts of your code that need to run really fast you can always use JNI and code the fast part in basically any language you want.
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.
Tried Eclipse?
Marcello
Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.
I disagree with that. On a basic level, it makes sense. However, it doesn't take into account that some languages were never developed fully (or properly at all!). And it doesn't justify a particular language's downfalls unless that language intentionally chose to take that downfall for the sake of another feature.
Tried Eclipse?
AFAIK, Eclipse doesn't use Java for GUI drawing, why else are there different versions for GTK2 and motif?
http://download.eclipse.org/eclipse/downloads/drops/S-3.2M6-200603312000/index.php
It uses SWT. It's an alternative to AWT and Swing. If you don't consider it Java, well, then this discussion is kind of moot.
Marcello
heh, sorry about that. I've only used Swing so far and I don't know much about SWT. That shows using a combo of Java and JNI can make a huge difference.
I think I should take a closer look at SWT
heh, sorry about that. I've only used Swing so far and I don't know much about SWT. That shows using a combo of Java and JNI can make a huge difference.
Well it can when you use JNI to be able to do a native GUI. I don't think you will achieve much by using it to optimizing slow parts and port them from Java to C++.
While the widgets may be responsive in eclipse its a pretty hefty program nonetheless. Compared to kdevelop and especially vim its a beast.
Compared to kdevelop and especially vim its a beast.
Can you compare them feature-wise also?
Yeah, a text editor isn't fully featured if you can't play Breakout with it...
Then everyone should stick with RHIDE and Setedit (the one I belive RHIDE uses).
Can you compare them feature-wise also?
Kdevelop most certainly. It's a fully featured IDE. Handles everything from C to Ruby. Built with QT toolkit of course.
Vim has almost all i need as far as text editing is concerned. Code collapse, syntax highlighting, indenting, regex find/replace, scripts, split windows (doubleplus good), and it even handles latex nicely. Normally I alt-tab into another window to build the project and run a nice debugger like kdbg.
Emacs is still much lighter than eclipse and is itself a whole operating system. It even comes with vim I can't be bothered with it though. Who needs to play tetris, manage files, and edit text in the same application
I just use the Editor that KDevelop itself uses. Kate. For now its enough, till I manage to get Scintilla ported to qt 4.1.
Actually I use both, KDevelop and Eclipse, quite a lot. Some things I miss from KDevelop is good code competition and refactoring. A bit more flexible code formatter would also be nice.
And of course, CDT frontend of GDB is just so nice with all the CPU registers and everything
Actually I use both, KDevelop and Eclipse, quite a lot. Some things I miss from KDevelop is good code competition and refactoring. A bit more flexible code formatter would also be nice.
If KDevelop has better refactory and (I assume you mean) code completion than Eclipse, then it must be amazing beyond belief. Eclipse is quite awesome. It's the first IDE I've ever used that I used again. Now I do all my coding in Eclipse since is so bloody awesome. As for code formatter, I'm not sure what you mean, you can use whatever convention you like (I imagine it can load others, too), although I personally stick by the Java one. I find BSD braces absolutely hideous and a waste of lines.
Marcello
If KDevelop has better refactory and (I assume you mean) code completion than Eclipse, then it must be amazing beyond belief.
I think my wording was a bit off. When I said "miss from KDevelop I meant I wished they were there in KDevelop.
That means I wish KDevelop had as good refactoring and code completion as Eclipse does. Same with code formatting.
I find BSD braces absolutely hideous and a waste of lines.
I won't argue with that. 2x19" isn't nearly enough screen space to waste it like that
>Can you compare them feature-wise also?
Kdevelop most certainly. It's a fully featured IDE. Handles everything from C to Ruby.
Last time I checked, KDevelop didn't support the more advanced J2EE stuff (like JSP code completion taking custom tags into account, EJBs, Graphical Struts editing, etc.), so it also depends on what do you want to use it for. I'd use something else if I were to develop in C/C++ though...
I find BSD braces absolutely hideous and a waste of lines.
I won't argue with that. 2x19" isn't nearly enough screen space to waste it like that
Yes, but using BSD style braces consequently, one can rather quickly bash out thousands of lines of code.