Is Java that bad?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

GrantSolar
Posts: 48
Joined: Mon Nov 16, 2009 7:19 pm UTC

Is Java that bad?

Postby GrantSolar » Sun Jan 31, 2010 7:46 pm UTC

Hi there!

Unnecessary Background:
I'm currently choosing which university to go to and an open day yesterday really swayed me towards Cardiff where I will study Computer Science. It looks to be a pretty cool place with 3 separate computer rooms for the 3 primary platforms. We spoke to a few students and their main gripe was with the fact that students have to use Java for the majority of the 3 years (They use Python as an introduction as there is no pre-requisite coding background).

My point:
I'm approaching the end of my A-level course where we used Visual Basic and I've been reading up on and know pretty much all the essentials for C++. Will Java be/Is Java such a killer as it was made out to be?

Unparallelogram
Posts: 336
Joined: Mon Jul 28, 2008 4:16 am UTC

Re: Is Java that bad?

Postby Unparallelogram » Sun Jan 31, 2010 8:19 pm UTC

Java is actually pretty straightforward as far as programming languages go. There is for the most part one way to do something, and while it tends to be kinda tedious, it's usually not hard to figure out. The basic syntax will be different than what you're used to, as will the whole objects and packages system, and some other things, but overall there's nothing that should cause you particular problems. Now, Java has a ton of stuff in its standard library and in the form of 3rd party stuff, but you're expected to use references for that, memorizing only the most common bits. Java itself is not going to pose you much challenge. What you use Java to do in the class is harder to say. Incidentally, Java shares some things in common with C++, and that should be a nice head start.

User avatar
MHD
Posts: 630
Joined: Fri Mar 20, 2009 8:21 pm UTC
Location: Denmark

Re: Is Java that bad?

Postby MHD » Sun Jan 31, 2010 8:36 pm UTC

Java just has a bad reputation because of its background as an interpreted (read slow) language, but many improvements has been made to make up for it since version 1.
The thing that many people (myself included) dislike about Java are a few design choices:
    1. Bytecode-only-compilation.
    Java compiles to bytecode which is then compiled just in time for execusion.
    pros: Bytecode is cross platform and other languages such as Clojure and Jython interface it.
    cons: Just In Time compilation and optimization gives bad execution time.
    2. Extremistic object oriented destign philosophy.
    Java is all about objects and the only way you can do anything in Java is with objects and methods.
    pros: Consistent design ideoms, everything except primitives is an object, etc.
    cons: No custom operator definitions resulting in methods like "BigInt.add(BigInt rhs)" instead of just an overloaded operator.
    Only limited support for imperative and functional code that sometimes come in handy in other languages.
    3. C/C++ derivative syntax.
    Java borrows heavily from C++.
    pros: Easy to grasp if you know C/C++/perl/w/e. (but really, syntax doesnt matter, seen one imperative language, seen 'em all.)
    cons: C++'s syntax is already pretty bad and ambigous already.
    Java makes things worse by removing operators, thus becoming EXTREMELY verbose.
EvanED wrote:be aware that when most people say "regular expression" they really mean "something that is almost, but not quite, entirely unlike a regular expression"

GrantSolar
Posts: 48
Joined: Mon Nov 16, 2009 7:19 pm UTC

Re: Is Java that bad?

Postby GrantSolar » Sun Jan 31, 2010 9:21 pm UTC

Thanks for the info. I've looked at a few snippets of code too and it seems like it shouldn't take an awful lot to get used to and I understand why they've chosen to teach it (The University puts a lot of emphasis on programs being cross-platform and portable) It's definitely going to be my back-up uni.

0xBADFEED
Posts: 687
Joined: Mon May 05, 2008 2:14 am UTC

Re: Is Java that bad?

Postby 0xBADFEED » Sun Jan 31, 2010 9:29 pm UTC

No. Java isn't that bad.

Most developers don't like it. It has probably the smallest feature set of any widely used modern language. It's very boring as far as languages go. There are very few tricks that let you demonstrate to everyone how clever you are. Stylistically and syntactically it's very plain-Jane, everyone's code looks like everyone else's. It's not "fun" to write and it's probably the most verbose of any of the major professional development languages. Hardly anyone thinks "Oooh fun I get to write some Java."

But if you judge it on ridiculous criteria like the quality of the standard library, the quality and availability of 3rd party libraries, the quality of core documentation, the quality of the platform, the ease of deployment, the maturity of tools, or the success of applications produced in the language, then it's probably one of the top languages around.

Most developers who have the Java-hate just don't like writing Java. It's not necessarily a rational or thought-out hate that takes into account all the various factors that determine the quality of a language. It's more an "I don't like writing Java, therefore Java sucks" thing.

I don't really like writing Java either.

User avatar
thoughtfully
Posts: 2253
Joined: Thu Nov 01, 2007 12:25 am UTC
Location: Minneapolis, MN
Contact:

Re: Is Java that bad?

Postby thoughtfully » Mon Feb 01, 2010 12:02 am UTC

0xBADFEED wrote:Most developers who have the Java-hate just don't like writing Java. It's not necessarily a rational or thought-out hate that takes into account all the various factors that determine the quality of a language. It's more an "I don't like writing Java, therefore Java sucks" thing.

I don't really like writing Java either.

It's also a bit of "Java really rubs my intuitions about good languages the wrong way. Wouldn't the world be a better place had this scourge work of mediocrity never been inflicted upon us created?"
Image
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

0xBADFEED
Posts: 687
Joined: Mon May 05, 2008 2:14 am UTC

Re: Is Java that bad?

Postby 0xBADFEED » Mon Feb 01, 2010 12:50 am UTC

thoughtfully wrote:It's also a bit of "Java really rubs my intuitions about good languages the wrong way. Wouldn't the world be a better place had this scourge work of mediocrity never been inflicted upon us created?"

I don't know about that. What took its place could have been a billion times worse. Imagine if VB had filled the Java role.

I wasn't trying to imply that I think Java is a good 'language' per se, just that the "Java sucks" crowd is missing the point of how to actually judge the value of a language.
As a general purpose language Java is extremely useful and usable. And in that respect, as it stands today, it is a good language to know. If you have an idea for a program you can probably do it in Java and there are probably tons of libraries to help you. It's a language that allows you to get shit done, even if the code isn't as elegant of succinct as it might be in a different language (this also pretty much sums up my views on C++). The issue of Java is becoming less and less important though as more languages spring up on the JVM offering Java interop, which is a good thing.

User avatar
Area Man
Posts: 256
Joined: Thu Dec 25, 2008 8:08 pm UTC
Location: Local

Re: Is Java that bad?

Postby Area Man » Mon Feb 01, 2010 3:01 am UTC

I think it was unfortunately marketed _way_ beyond its capabilities, sold as new and innovative, as though Sun invented OOP, but was really just hype -- never that good and there are better solutions. The 90s was a crazy time.
Bisquick boxes are a dead medium.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Is Java that bad?

Postby Earlz » Mon Feb 01, 2010 5:36 am UTC

Java is probably the most annoying language I've used for any amount of time.. Its bad enough that if I got a job programming in it, I'm not sure I'd take it... I had to learn Java for the AP test in high school.

Java as a language I guess, is just another annoying language(like C++ if you took out the C part that makes it fun) But if your considering going to a school that teaches in nothing but Java, I recommend reading this http://www.joelonsoftware.com/articles/ ... hools.html

I strongly believe every programmer should know how to live without garbage collection even if they never have to in real life.
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Is Java that bad?

Postby You, sir, name? » Mon Feb 01, 2010 12:15 pm UTC

Java is good to know, and it's awesome for rapid-prototyping and portability, but it's also kind of nasty to write bigger and more serious code in. I wouldn't want to have Java be my primary language, but it's useful enough that I wouldn't want to not know it either.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
_Big_Mac_
Posts: 83
Joined: Sun Sep 07, 2008 8:30 pm UTC
Location: Poland

Re: Is Java that bad?

Postby _Big_Mac_ » Mon Feb 01, 2010 3:33 pm UTC

Another opinion:

If you want to land a job fast, learning Java is a good idea. If you want to learn CS, learning Java is not enough (note: not a bad idea, simply not enough). The thing is, there isn't really much to Java that is transferable and generalizable except OOP. It's a simple language that lives by its powerful APIs - which isn't a bad thing for a production language but what happens when Java goes out of style, as every language does? Your deep knowledge of the APIs will suddenly become useless and all that you're left with will be Object Oriented Programming. If some other paradigm gains popularity by then, you'll be as useless as Pascal programmers today (no offense intended, Pascal coders). Java doesn't expose many aspects of CS that other languages might, so you're loosing whole fields of CS just because the choice of language is limiting you. A language should never be the limiting factor for any programmer, let alone CS major - it's a tool, nothing more.

So IMO it's not that Java is evil. Schools that teach Java exclusively without exposing their students to other languages, approaches, paradigms etc. are evil. They mass produce Java programmers while they should raise programmers that happen to know Java or better yet, CS experts that may happen to be programmers that happen to know Java. Not so immediately exploitable by the market but a better choice for the students in the long run.

LikwidCirkel
Posts: 169
Joined: Thu Nov 08, 2007 8:56 pm UTC
Location: on this forum (duh)
Contact:

Re: Is Java that bad?

Postby LikwidCirkel » Mon Feb 01, 2010 6:07 pm UTC

What many students fail to realize is that the language of choice in most university courses is arbitrary and largely irrelevant. I bet the courses are named things like "data structures", "algorithms", "real-time systems" etc., and you'll rarely see courses with actual programming languages in their names.

This is because, university courses teach concepts, not languages. Realistically, if you learn any procedural or object oriented language well, you'll be able to pick up others very easily. Don't like Java? Learn C++, python, or something else on your own time. It's really not that much effort once you understand concepts related to the programming paradigm.

I'm not much of a fan of Java for real-world code for reasons already mentioned, but in an academic environment, I think it has more merit. If a course is about data structures, using Java will just remove the need to cover language nitty-gritties of C++ or other things, so the content can focus on data structures.

I've witnessed a couple universities that change the language of choice frequently, depending on the time and the professor's preferences. In the course of 6 years, the same course went from Pascal to Java to C++, and now they're using Python. This is the exact same course, with the exact same covered material, just taught in different semesters.

I'd advise not to worry about it too much - in the end, it's understanding the concepts and fundamentals that's important, and the actual language is pretty irrelevant and abstract.

Most universities don't want to produce "Java Programmers". That's what technical colleges are for. Universities produce computing scientists, and computer engineers, and chances are when you walk into industry, your workplace will use a language that your unfamiliar with, but your employer won't care, and neither should you, because they've hired a worker who's capable of adapting, because s/he solidly understands the required concepts.

User avatar
evilbeanfiend
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Re: Is Java that bad?

Postby evilbeanfiend » Mon Feb 01, 2010 6:45 pm UTC

good call, students are often too focused on learning languages that will be used in industry. in 4 years time all the cool jobs might be in the_next_big_thing (tm), and you will be able to pick up the syntax quickly if you understand the concepts. working in IT means needing to continuously adapt to and learn new technologies anyway so picking up a new language is just par for the course. concentrate on paradigms and concepts not languages + implementations.
in ur beanz makin u eveel

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Is Java that bad?

Postby Earlz » Tue Feb 02, 2010 1:16 am UTC

LikwidCirkel wrote:What many students fail to realize is that the language of choice in most university courses is arbitrary and largely irrelevant. I bet the courses are named things like "data structures", "algorithms", "real-time systems" etc., and you'll rarely see courses with actual programming languages in their names.

This is because, university courses teach concepts, not languages. Realistically, if you learn any procedural or object oriented language well, you'll be able to pick up others very easily. Don't like Java? Learn C++, python, or something else on your own time. It's really not that much effort once you understand concepts related to the programming paradigm.

I'm not much of a fan of Java for real-world code for reasons already mentioned, but in an academic environment, I think it has more merit. If a course is about data structures, using Java will just remove the need to cover language nitty-gritties of C++ or other things, so the content can focus on data structures.

I've witnessed a couple universities that change the language of choice frequently, depending on the time and the professor's preferences. In the course of 6 years, the same course went from Pascal to Java to C++, and now they're using Python. This is the exact same course, with the exact same covered material, just taught in different semesters.

I'd advise not to worry about it too much - in the end, it's understanding the concepts and fundamentals that's important, and the actual language is pretty irrelevant and abstract.

Most universities don't want to produce "Java Programmers". That's what technical colleges are for. Universities produce computing scientists, and computer engineers, and chances are when you walk into industry, your workplace will use a language that your unfamiliar with, but your employer won't care, and neither should you, because they've hired a worker who's capable of adapting, because s/he solidly understands the required concepts.


tl;dr.

Well, you can't teach pointer arithmetic in Java, thats for sure.
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Is Java that bad?

Postby Rysto » Tue Feb 02, 2010 1:51 am UTC

Earlz wrote:Well, you can't teach pointer arithmetic in Java, thats for sure.

Pointer arithmetic is only possible in two languages, and with modern compilers using pointer arithmetic will rarely produce faster code anyway.

bieber
Posts: 223
Joined: Thu Mar 13, 2008 12:13 am UTC

Re: Is Java that bad?

Postby bieber » Tue Feb 02, 2010 2:25 am UTC

Rysto wrote:
Earlz wrote:Well, you can't teach pointer arithmetic in Java, thats for sure.

Pointer arithmetic is only possible in two languages, and with modern compilers using pointer arithmetic will rarely produce faster code anyway.


Only two? I assure you, I can do it in C, C++, assembly, and probably several others I don't know. Not that I would, but just sayin'...

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Is Java that bad?

Postby Earlz » Tue Feb 02, 2010 5:58 am UTC

bieber wrote:
Rysto wrote:
Earlz wrote:Well, you can't teach pointer arithmetic in Java, thats for sure.

Pointer arithmetic is only possible in two languages, and with modern compilers using pointer arithmetic will rarely produce faster code anyway.


Only two? I assure you, I can do it in C, C++, assembly, and probably several others I don't know. Not that I would, but just sayin'...


It doesn't matter if you ever use it in real life, if you don't understand how pointers truly work, you don't fully understand programming.

I'm also one of those that think everyone should have an assembly course as well though
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Is Java that bad?

Postby Xanthir » Tue Feb 02, 2010 2:00 pm UTC

I support Earlz's assertion. Pointers are a perfect example of a particular kind of indirection which is extremely valuable to learn. As well, they help teach the underlying memory architecture, aid in understanding other data structures like cons cells, and allow you to actually understand the difference between call-by-value and call-by-reference.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

bieber
Posts: 223
Joined: Thu Mar 13, 2008 12:13 am UTC

Re: Is Java that bad?

Postby bieber » Tue Feb 02, 2010 4:06 pm UTC

Is there really a serious university out there that offers a CS degree not requiring classes on computer organization and systems software?

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Is Java that bad?

Postby Earlz » Wed Feb 03, 2010 3:52 am UTC

bieber wrote:Is there really a serious university out there that offers a CS degree not requiring classes on computer organization and systems software?


From what I've seen and heard: yes.
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

bieber
Posts: 223
Joined: Thu Mar 13, 2008 12:13 am UTC

Re: Is Java that bad?

Postby bieber » Wed Feb 03, 2010 4:32 am UTC

Earlz wrote:
bieber wrote:Is there really a serious university out there that offers a CS degree not requiring classes on computer organization and systems software?


From what I've seen and heard: yes.


Hmm, wonder if I could get the folks who grumble non-stop in Systems to transfer there :P

User avatar
Arancaytar
Posts: 1642
Joined: Thu Mar 15, 2007 12:54 am UTC
Location: 52.44°N, 13.55°E
Contact:

Re: Is Java that bad?

Postby Arancaytar » Wed Feb 03, 2010 12:57 pm UTC

I started out with Java, then learned Python, and am never going to go back. In Python, object orientation is actually a tool, rather than a constraint that gets in the way... (oh, and of course operator overloading + concise, flexible iteration syntax).
"You cannot dual-wield the sharks. One is enough." -Our DM.
Image

Daving
Posts: 2
Joined: Wed Feb 03, 2010 7:41 am UTC

Re: Is Java that bad?

Postby Daving » Wed Feb 03, 2010 5:42 pm UTC

Well, if you wan't to make games- and serious games not 2d / flash style, then don't go with Java. All the programming I do revolves around high performance code, like high polygon open gl stuff, or multimedia. For me, Java isn't practical when every iteration of a loop counts. Even NetBeans their Star application... a Java Compiler written in Java... runs unacceptably slow on my (powerhouse) machine. How hard is it to muck-up a sophisticated TEXT editor?

If you wan't to target your project cross platform, esp mac / win users, and your programs won't have a high overhead then go with Java. Save's the hassle of localization & recompiling c++ code.

However I agree with the people above: things like pointers, malloc(), et all, are too valuable to skip over.

bieber
Posts: 223
Joined: Thu Mar 13, 2008 12:13 am UTC

Re: Is Java that bad?

Postby bieber » Wed Feb 03, 2010 6:13 pm UTC

Daving wrote:Even NetBeans their Star application... a Java Compiler written in Java...


Umm... :roll:

chewywater
Posts: 8
Joined: Wed Feb 24, 2010 4:36 pm UTC

Re: Is Java that bad?

Postby chewywater » Wed Feb 24, 2010 5:22 pm UTC

Yes and no.
I programmed in java for 5 years in the late 90s and early 2000s.
I love to write in it but I tend to avoid apps written in it.

What's good about java:
Java is a great 'learning' language.
Sun provides tons of help and support and a huge framework that is easy to learn.

What's bad about java:

If you have any scientific bent at all, it's impossible to ignore that the majority of apps written in java feel clunky and slow. The hype surrounding java is in direct contradiction to the quality of most apps written in the language.

Users care about performance WAY more than they care about running on multiple platforms. On my mac I always prefer the app written in assembly to one written in java. There is almost always a compiled alternative to any java app, and I usually choose that alternative. I also resent having to keep the jre up to date for sun's special language.

Sun always blames the programmer for the "java is slow" problem.
Yes. There are examples of java programs that are responsive and professional. But just because someone built a really great house out of popsicle sticks once does not prove popsicle sticks are a great building material for the masses.

My final advice to new programmers:

For the student who wants to learn general OO techniques like: 'write to an interface not a class' and 'prefer composition over inheritance' , code in java and enjoy it.
When you are writing an app you want to sell, continue to use your OO techniques, but choose a high performance/compiled language.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Is Java that bad?

Postby Earlz » Wed Feb 24, 2010 5:54 pm UTC

chewywater wrote:Yes and no.
I programmed in java for 5 years in the late 90s and early 2000s.
I love to write in it but I tend to avoid apps written in it.

What's good about java:
Java is a great 'learning' language.
Sun provides tons of help and support and a huge framework that is easy to learn.

What's bad about java:

If you have any scientific bent at all, it's impossible to ignore that the majority of apps written in java feel clunky and slow. The hype surrounding java is in direct contradiction to the quality of most apps written in the language.

Users care about performance WAY more than they care about running on multiple platforms. On my mac I always prefer the app written in assembly to one written in java. There is almost always a compiled alternative to any java app, and I usually choose that alternative. I also resent having to keep the jre up to date for sun's special language.

Sun always blames the programmer for the "java is slow" problem.
Yes. There are examples of java programs that are responsive and professional. But just because someone built a really great house out of popsicle sticks once does not prove popsicle sticks are a great building material for the masses.

My final advice to new programmers:

For the student who wants to learn general OO techniques like: 'write to an interface not a class' and 'prefer composition over inheritance' , code in java and enjoy it.
When you are writing an app you want to sell, continue to use your OO techniques, but choose a high performance/compiled language.


Nitpick: Don't use the color red for text, that is how the moderators communicate.

I think Java just puts too many constraints on the programmer where they are not needed. I mean, if your going to learn a language that isn't super fast(not compiled) then you might as well learn something fun like Ruby or Python or even C#(slightly less fun).
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Is Java that bad?

Postby You, sir, name? » Wed Feb 24, 2010 6:25 pm UTC

As for Java application sluggishness, it's more of a latency problem than a speed problem. JIT-compiled Java code on a modern machine is obviously a lot more computationally powerful than native code on a 15 year old machine, yet the latency of a java GUI written in AWT/Swing on a modern machine is orders of magnitude worse than a comparable GUI on a 15 year old machine. I think SWT is better, but I'm not sure how much.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

chewywater
Posts: 8
Joined: Wed Feb 24, 2010 4:36 pm UTC

Re: Is Java that bad?

Postby chewywater » Wed Feb 24, 2010 7:44 pm UTC

Earlz wrote:Nitpick: Don't use the color red for text, that is how the moderators communicate.

I want to say to each of you, simply and directly, I am deeply sorry for my irresponsible and selfish behavior I engaged in. I am also aware of the pain my behavior has caused to those of you in this room. I have let you down, and I have let down my fans. For many of you, especially my friends, my behavior has been a personal disappointment. etc...

I think Java just puts too many constraints on the programmer where they are not needed. I mean, if your going to learn a language that isn't super fast(not compiled) then you might as well learn something fun like Ruby or Python or even C#(slightly less fun).

Yeah I agree. If you're going to go to use a 'learning language' why not go higher level..CLOS etc..
Except for maybe one thing. Java is so similar in syntax to C++ that the transition to the higher performance language is much gentler. Asking "How do I get the behavior of a java interface in C++" is a much easier question than "How do I program C++ like I did in CLOS?"

But yeah other than that I'd agree.

chewywater
Posts: 8
Joined: Wed Feb 24, 2010 4:36 pm UTC

Re: Is Java that bad?

Postby chewywater » Wed Feb 24, 2010 8:15 pm UTC

You, sir, name? wrote:As for Java application sluggishness, it's more of a latency problem than a speed problem. JIT-compiled Java code on a modern machine is obviously a lot more computationally powerful than native code on a 15 year old machine, yet the latency of a java GUI written in AWT/Swing on a modern machine is orders of magnitude worse than a comparable GUI on a 15 year old machine. I think SWT is better, but I'm not sure how much.


I'll take your word for it, as I am now out of the programming game.
I remember having to twerk the heck out of Swing to make it responsive. It WAS possible but it's oh so much better to use a framework that is fast out of the box.
Judging by the performance of the eclipse application, SWT is a little better, but still feels kinda clunky.

Of course there's always:
http://gcc.gnu.org/java/
or
http://www.digitalmars.com/d/

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Is Java that bad?

Postby You, sir, name? » Wed Feb 24, 2010 8:43 pm UTC

chewywater wrote:Of course there's always:
http://gcc.gnu.org/java/


Well, java is JIT-compiled into native binary code nowadays (this gives it a vast speed boost over interpreted java), and that almost always outperforms GCJ. But it's still sluggish.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Is Java that bad?

Postby Berengal » Wed Feb 24, 2010 9:37 pm UTC

I've used many java apps that are fast, responsive, frugal about memory and bug-free with a native look-and-feel. They're a pleasure to use, like any high-quality software.

I've also used many C++ apps that are slow, leak memory like a sieve and segfault every five minutes. It feels like a bunch of twigs fastened together with baling wire. Bad quality java apps aren't like that.

What bad java apps are, however, are fisher-price cars. They're slow, unresponsive, run five major collections each second and slowly turns into molasses. You can always tell when poor-quality software is written in Java, the code smell is so strong. Also, there's lots of them.

That said, the current JVM implementations are freakish monsters, able to turn many decent-but-not-great programs fast, frugal and responsive. JIT compilation has a huge advantage over regular compilation; access to runtime profiling information, and the option to recompile when the profile changes (although I'm not sure if the current implementations do this yet). For example, if a null dereference is unlikely it can ommit checking for it and instead catch SIGSEGV, even though this is much slower in the case that it is null. This condition of few nulls may only arise when run with certain arguments, or a certain configuration, or some other runtime input, information a static compiler doesn't have and cannot rely on.
chewywater wrote:Judging by the performance of the eclipse application, SWT is a little better, but still feels kinda clunky.
On the topic of IDEs, NetBeans uses swing, looks native and feels responsive (more so that eclipse. I've switched). I don't know the amount of twerking that's been going on though, but so far the plugins I've tried are also responsive, which suggests that swing itself can be responsive these days without too much twerking.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Is Java that bad?

Postby You, sir, name? » Wed Feb 24, 2010 10:31 pm UTC

Responsiveness has probably increased with the advent of multi-core CPUs (where the GC can run in a separate thread). On the other hand, I think garbage collection is the cause of many of Java's performance problems. Not in the sense that it's bad thing for well written code, but because of the sort of careless programming that it encourages. While you don't have to deallocate your objects, wanton object-creation is not a good paradigm. And Java's object-fetishism hardly makes things better.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Is Java that bad?

Postby Berengal » Wed Feb 24, 2010 10:44 pm UTC

You, sir, name? wrote:Responsiveness has probably increased with the advent of multi-core CPUs (where the GC can run in a separate thread).
AFAIK it still uses stop-the-world GC, at least for major collections.
You, sir, name? wrote:While you don't have to deallocate your objects, wanton object-creation is not a good paradigm.
Indeed. I don't think it's the allocation that's killing performance though, but running constructors. If you decouple data from behaviour you can allocate alot of garbage without too much overhead, assuming a decent GC implementation. GHC, for example, has blazingly fast allocation, and you wouldn't notice too big a difference in walking down a list three times instead of just once (with all computation rolled up into one function instead of spread out over three different recursion schemes) as long as all intermediary values are immediately garbage. It won't be equally fast, but the overhead is most likely shadowed by whatever else you're doing.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

0rm
Posts: 81
Joined: Wed Feb 17, 2010 2:30 pm UTC

Re: Is Java that bad?

Postby 0rm » Thu Feb 25, 2010 1:09 pm UTC

Java is a purely object oriented intepreted language that allows you to directly port your source code to any platform. It is also the language that competes with C# and has huge success in that area. Java is a language that alot of C++ programmers (like me) openly hate and secretly love.

Berengal wrote:
You, sir, name? wrote:Responsiveness has probably increased with the advent of multi-core CPUs (where the GC can run in a separate thread).
AFAIK it still uses stop-the-world GC, at least for major collections.
You, sir, name? wrote:While you don't have to deallocate your objects, wanton object-creation is not a good paradigm.
Indeed. I don't think it's the allocation that's killing performance though, but running constructors. If you decouple data from behaviour you can allocate alot of garbage without too much overhead, assuming a decent GC implementation. GHC, for example, has blazingly fast allocation, and you wouldn't notice too big a difference in walking down a list three times instead of just once (with all computation rolled up into one function instead of spread out over three different recursion schemes) as long as all intermediary values are immediately garbage. It won't be equally fast, but the overhead is most likely shadowed by whatever else you're doing.


I would think that any object that simply holds methods and not data would not be very costly to allocate. Isn't there a design pattern that uses objects to add extra options/methods to existing objects?
They say it's unhackable; I think it can be hacked.
They say it's fast; I think it could be faster.
They say it's the best; I think it can be done better.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Is Java that bad?

Postby You, sir, name? » Thu Feb 25, 2010 2:18 pm UTC

Berengal wrote:
You, sir, name? wrote:Responsiveness has probably increased with the advent of multi-core CPUs (where the GC can run in a separate thread).
AFAIK it still uses stop-the-world GC, at least for major collections.


That is quite scary to hear.
0rm wrote:Java is a purely object oriented intepreted language that allows you to directly port your source code to any platform. It is also the language that competes with C# and has huge success in that area. Java is a language that alot of C++ programmers (like me) openly hate and secretly love.


Somewhat bit dubious history-writing there. C# is a blatant copy of Java.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

0rm
Posts: 81
Joined: Wed Feb 17, 2010 2:30 pm UTC

Re: Is Java that bad?

Postby 0rm » Thu Feb 25, 2010 2:22 pm UTC

I meant C# gets the crap kicked out of it by Java. Sorry if that was taken the wrong way. I fucking hate C# with the strength of 9001 suns.
They say it's unhackable; I think it can be hacked.
They say it's fast; I think it could be faster.
They say it's the best; I think it can be done better.

Notch
Posts: 318
Joined: Tue Dec 12, 2006 5:52 pm UTC
Location: Stockholm, Sweden
Contact:

Re: Is Java that bad?

Postby Notch » Thu Feb 25, 2010 2:27 pm UTC

I'm an avid java developer. I run my own company, making an applet game which brings in quite a lot of cash at the moment (1400 euro in just the last 24 hours :D).

Java has some issues, certainly, but it's faster than Actionscript, and it can run in a browser without too much trouble, and it even runs on Mac and Linux.
If I was making a game for consoles, I'd probably use C/C++.

If Flash ever gets proper OpenGL support, I'd ditch Java in a heartbeat, even if it still was slower than Java.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Is Java that bad?

Postby Earlz » Thu Feb 25, 2010 2:36 pm UTC

0rm wrote:I meant C# gets the crap kicked out of it by Java. Sorry if that was taken the wrong way. I fucking hate C# with the strength of 9001 suns.


Um, why? I've always been under the impression that C# won the war against Java

Notch wrote:I'm an avid java developer. I run my own company, making an applet game which brings in quite a lot of cash at the moment (1400 euro in just the last 24 hours :D).

Java has some issues, certainly, but it's faster than Actionscript, and it can run in a browser without too much trouble, and it even runs on Mac and Linux.
If I was making a game for consoles, I'd probably use C/C++.

If Flash ever gets proper OpenGL support, I'd ditch Java in a heartbeat, even if it still was slower than Java.


Umm, HTML 5? That will actually be capable of being hardware accelerated depending on the browser...
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Is Java that bad?

Postby You, sir, name? » Thu Feb 25, 2010 2:43 pm UTC

Earlz wrote:Um, why? I've always been under the impression that C# won the war against Java


It won one battle: Windows machines. But basically anywhere else, mono is doing laughably poor.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Is Java that bad?

Postby Berengal » Thu Feb 25, 2010 2:48 pm UTC

0rm wrote:I would think that any object that simply holds methods and not data would not be very costly to allocate. Isn't there a design pattern that uses objects to add extra options/methods to existing objects?

It's not allocation itself that's costly, but running the constructors. In Java, all data has to be in an object, all objects must belong to a class, all classes need a constructor, all public classes need to be in their own file and there's very poor IDE support for multiple classes in a single file (to the point where it's a useless enterprise to even try), there are no type-safe products and no sums at all built in or even in the standard library, you can't change the class of an object after it's creation, frameworks that often require default no-argument constructors for your objects and no way to have more than one no-argument constructor. All these and more lead to a language that's hostile towards data in general, and most datatypes do more than strictly neccessary, not just in that they might have more methods or fields than they strictly need, but quite literally when it comes to initialization. If you have an object that has several stages of initialization you need to either write multiple classes, possibly without the aid of inheritance even (leading to a project that's bloated with classes and an utterly incomprehensible structure), write different init() methods making many function calls temporally dependent on eachother (leading to utterly incomprehensible code) or somehow mash all the stages into one if that's possible. People often opt for the last one since it's the nicest.

If you're thinking of the decorator pattern, then that's a perfectly fine pattern that has very little to no overhead. It can sometimes be used to fake multiple initialization stages, but it has its own problems and limitations, especially when it comes to "beans"...

You, sir, name? wrote:
Earlz wrote:Um, why? I've always been under the impression that C# won the war against Java


It won one battle: Windows machines. But basically anywhere else, mono is doing laughably poor.
As platforms .NET won the windows application market, but the JVM is still king "enterprise server thingamabob" platform. As languages though, C# trounces Java. The JVM has Scala and Clojure though, which are very awesome languages compared to both C# and Java. It's a big shame how neither platform properly supports TCO, and are still plagued by nulls.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 11 guests