Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Java Programming IT Technology

Have a Nice Steaming Cup of Java 5 859

wap writes "The language/VM/religion that everyone loves to hate is now serving another cup: Java 1.5 is ready for download. The new features of 1.5 have been discussed here before. I, for one, welcome our new virtual machine overlord. I have been using the release candidate, and startup times are noticeably faster, as is overall performance, and the new features like typesafe collections and static imports are great to have. Let the Java flames begin!"
This discussion has been archived. No new comments can be posted.

Have a Nice Steaming Cup of Java 5

Comments Filter:
  • I wait! (Score:5, Insightful)

    by orangeguru ( 411012 ) on Thursday September 30, 2004 @08:50AM (#10393168) Homepage
    I wait for the first bug reports ... and version 1.5.1 ...
  • by nhnfreespirit ( 809462 ) on Thursday September 30, 2004 @09:06AM (#10393284) Journal
    In typical /. style, as soon as Java is as much as mentioned, everybody expects the flame wars to erupt, and they always do...

    I try to stay pragmatic about the programming languages that I use. For some jobs, Java would be my last choice, and for some it seems a natural fit. When writing hardware near code, or platform dependant stuff on driver level, nobody in their right mind would attempt to use Java. For high level rapid prototyping, Java is a often a quick and easy way of getting things done.
  • by smari ( 257143 ) <(si.rajye.gulv) (ta) (mps)> on Thursday September 30, 2004 @09:06AM (#10393287) Homepage
    No.. say I want to port Perl to my ToasterOS. I download Perl, compile it on ToasterOS (Presuming ToasterOS has all the prerequisites), and voila.

    Java is not open source, hence I do not go around compiling it anywhere.. I just wait and hope that Mr. Star gives a yellow light on the project.
  • by Anonymous Coward on Thursday September 30, 2004 @09:06AM (#10393294)
    It's possible to have memory leaks in Java if you don't write your programs well.

    For example, you could have the following code:

    SomeClass hugeObject = new SomeClass();
    hugeObject.loadUngodlyStuff();
    /* hugeObject is a database, and you've just read 256 MB worth of entries into it. It's sitting there taking up memory. */

    hugeObject.doSomeManipulations();

    /* okay, now we're done with hugeObject. We enter some kind of main loop for our program in which hugeObject is never used again, but there is still a reference to it sitting there, and the garbage collector might not know enough to garbage collect it for you JUST IN CASE you might want to reference it later */

    while(true){
    doSomething();
    }

    This could be fixed by inserting "hugeObject = null" right before while(true){...}. So, yes, you can have memory leaks in Java, but if you do, it's really your own fault.

  • by joib ( 70841 ) on Thursday September 30, 2004 @09:08AM (#10393302)

    Java should never have memory leaks...
    All the memory managment should be done by the VM as far as I know...
    unless there is some advanced stuff i'm just not aware of?


    Not memory leaks as such, but "memory leaks" for all practical purposes. How? Well, if you forget to nullify references to objects you no longer use, the garbage collector obviously cannot reclaim that memory..
  • by Anonymous Writer ( 746272 ) on Thursday September 30, 2004 @09:08AM (#10393304)
    Java had all this hype about it when it was promoted nearly a decade ago, but it never got anywhere close to the point where you could walk into your local computer store and buy a major software package that could be run on any platform. I recall that Corel was going to attempt to release a WordPerfect that ran using Java, but that's the most I heard of it being adopted by mainsteam software developers. Does anyone think it will ever take?
  • by Brian Blessed ( 258910 ) on Thursday September 30, 2004 @09:08AM (#10393306)
    I thought that the compiled Java would remain compatible with the bytecode format used by previous versions. However, this seems not be the case and I get this message:
    java.lang.UnsupportedClassVersionError: HelloWorld (Unsupported major.minor version 49.0)

    Whilst code that uses the new language features must obviously be compiled with the v1.5 JSDK, this means that it must also be run on the v1.5 JRE.

    This may inhibit the use of Java 5 by projects that want their programs to run on a v1.4 JRE.

    - Brian.
  • by Anonymous Coward on Thursday September 30, 2004 @09:11AM (#10393323)
    I hate to say this, but:
    your cut is the fact you can use it for free!

    A. Coward
  • mod parent down (Score:5, Insightful)

    by hruntrung ( 89993 ) on Thursday September 30, 2004 @09:11AM (#10393331)
    That's not interesting, that's cliche. People have been saying that for years. Let's be honest: virtual machines are where business code is going, and business code (enterprise applications, server side stuff, etc) is the primary focus of Java these days. .NET is a clear indication that this trend is a real one, and that that's where the industry is heading.

    No, I don't think you should write ls or grep in Java. However, I'd say that you also shouldn't be writing an invoice processing system in C or C ++.

  • Re:5 or 1.5? (Score:5, Insightful)

    by Cederic ( 9623 ) on Thursday September 30, 2004 @09:14AM (#10393356) Journal

    Fairies have wings, not tails.

    I agree though, the naming of Java is consistently confusing. Should I upgrade from Java 2.. err.. J2SE.. err.. Java 1.3.1_08 to Java 5 or to Java 1.5 or indeed Java 1.5.0. Oh, and is J2EE 1.4 compatible with this new one?

    It could be much simpler..

    ~Cederic
  • by timbloid ( 208531 ) on Thursday September 30, 2004 @09:18AM (#10393391)
    > Its' not the case in Java where it sounds like there's only 1 way to do each thing

    I take it from this comment that you haven't actually tried java. You can "explorate" to your hearts content, and there are many ways of doing the same thing (some obviously better than others)

    > mostly because of the plethora of APIs (WebLogic, etc.) that corporations force you to use over it...

    Now this comment just has me bamboozled... You mean that Weblogic holds sway over you and force you to code in one way over another? Surely weblogic [bea.com] is just an appserver? Which runs code designed to the standard J2EE API spec? The same as using Tomcat [apache.org] , JBoss [jboss.org] or Geronimo [apache.org] or even Hibernate [hibernate.org]? (All of which are free and opensource, and follow the same J2EE spec that Weblogic does -- they just solve separate parts of it, and can be combined to do it all if you require)... I fail to see how this is a corporation forcing you to use one method of coding?

    Sure, if you are only going to look at one way of achieving your goals, then there is only one way to go...
  • Dear Sun (Score:2, Insightful)

    by mindaktiviti ( 630001 ) on Thursday September 30, 2004 @09:18AM (#10393400)
    Please make your Windows (XP) Java run time environment download available on the FRONT PAGE or at the most 1 click away. Your latest website is very tricky to navigate and very annoying and what's the point of taking a Java class (which I'm currently doing) when the majority of Windows XP users don't even have the fucking run time installed by default (damn Microsoft!). I mean look at this mess [sun.com]. It's 5 clicks to the .exe file! Who is Joe Schmoe going to know what the hell a "run time environment" is when they're NOT EVEN interested in Java, except in the software they want to install! (i.e. Azureus bittorrent client). Please add a image button (so people see it, make it big and pink or red if you will) that says something like "Windows XP users DOWNLOAD to run your favourite Java applications!" Thank you. Yours Truly, Typical-Family's-Free-College-Long-distance-Tech-S upport.
  • by jbrocklin ( 613326 ) on Thursday September 30, 2004 @09:19AM (#10393401) Homepage Journal
    Yes! Thank you! I've never liked java all that much - not because the coding is difficult, I just don't like the vm interface to things. I can write something up in perl, and run it wherever I like!

    I don't particularly like the idea of many colleges wanting to move to Java as the language of choice. Sure it hides a lot of things from a new programmer, but if someone is going to college in computer science - they shouldn't have it hidden from them! Not to mention that C++ is somewhat of a 'standard' language. Learn it and you can move to other languages REALLY easily. Just my $0.02....
  • by DevCybiko ( 694026 ) on Thursday September 30, 2004 @09:21AM (#10393436) Homepage Journal
    The new For loop may seem to be just syntactic sugar, but it isn't. It really does make the code look a lot cleaner isn't that the definition of syntactic sugar?
  • by Cederic ( 9623 ) on Thursday September 30, 2004 @09:22AM (#10393445) Journal

    I would hope that 1.2, 1.3 and 1.4 bytecode would run in the 1.5 JRE. I think it's ambitious to expect 1.5 bytecode to run in a pre-1.5 JRE - the language has new features that such JREs don't know about or support.

    While you could obviously write code that interprets 1.5 bytecode so that it will run on a 1.4 JRE, and make it possible to automagically create that code at compile-time, including it by default in the compiled 1.5 code would be wasteful as it's not required to run in a 1.5 environment.

    So yes, it will inhibit the use of Java 5 by projects that wish to run on JRE1.4. And trust me, I'm extremely distressed that my company is still stuck on Weblogic 6.1 as that only works with JRE1.3, so I haven't even been able to make use of J2SE 1.4 capabilities in code, but life goes on.

    ~Cederic
  • by $RANDOMLUSER ( 804576 ) on Thursday September 30, 2004 @09:24AM (#10393457)
    Right. Those Java checked exceptions are so "confusing".
  • Re:Is it C# yet? (Score:4, Insightful)

    by MemoryDragon ( 544441 ) on Thursday September 30, 2004 @09:25AM (#10393471)
    No Hjelfsberg is totally right. The extensions are syntactic sugar. But still they are useful, because, you gain coding efficiency that way. Autoboxing, foreach, generics are all implemented in a way not to break the byte format, but you still need less code for doing jobs like iterating lists fetching elements from data structures and so on. Day to day stuff which you used every 10th line or os.

    Priority #1 for Sun was not to break the bytecode format. Priority #2 was to ease the life of programmers

    The only thing which really will make a difference on code generation level will be the meta data, this one will make life easier for the implementors and for the users of servers. Soap instantly comes to my mind with the C# like @webmethod metadata. No more post and precompilers for doing that stuff, yiehaa.

    Hjelfsberg is a smart guy, although I dont share his views on unmanaged exceptions, he is dead right with his comment on this.
  • by pottymouth ( 61296 ) on Thursday September 30, 2004 @09:30AM (#10393508)
    Here's why:

    http://www.joelonsoftware.com/articles/APIWar.ht ml

    If you like C#, VB and .NET that's fine. Unfortunately MS's revenue stream requires that they change your environment on a regular basis. In my opinion that's the worst thing in the world for professional developers. Proficiency comes with experience and if you shift the syntax and grammer around on me every couple of years it's pretty hard to get really good at anything. At least Java is, pretty much, the same now as it's always been for nearly 10 years. Can you say that about VB?
  • I love the hate (Score:5, Insightful)

    by Featureless ( 599963 ) on Thursday September 30, 2004 @09:30AM (#10393513) Journal
    You can't hate any language as much as some people hate Java until it's really reached critical mass.

    There are two things that make any really big language a target: 1) people start using it for everything, including things its not suited for. 2) junior folks without a lot of compiler or cross-language experiences will cut their teeth on Java, and at that point in one's career it is sometimes considered cool to blame a bad application's flaws on the language it's written in.

    Java has plenty of problems. There are brilliant essays written on it; some of them by Sun engineers. But the complaint linked to in story was so bad by comparison, however, I doin't feel offtopic in addressing some points it raised:

    there are a thousand "super-efficient" .jar libraries required by a "Hello World" app

    No.

    it takes 12 objects instantiated in 4 containers to flip a bit in a byte

    Oh, I see. You're flipping bytes.

    there is the substitution of native performance of compiled code to code compiled "Just Too Late" combined with exceptional memory usage that entails

    The VM is more work. Strangely, you will have trouble finding benchmarks that make other comparable high-level languages look way faster than Java on the same _non-user-facing_ application.

    As always, code in C, assembler, or another specialized language if you really need to.

    The speed thing is well-addressed elsewhere. Enough said for now.

    we get the garbage collector which is scientifically fine-tuned to run just when user is expected to interact with the application in most time sensitive manner

    People love to bitch about client-side Java. It's as if all the flaws they're used to from other client side systems are fine, because they're used to them, and every foible of Java is worth agonizing over as if it were the worst thing in the world.

    I dunno what else to say, but I wrote an enormous graphic-intensive video game in it and it runs fine. And what I did is nothing; somebody cloned the QIII engine to the point where it plays actual Q3A maps (with multiplayer) at respectable framerates.

    Once again, someone shows me a shitty client app written by a team of 30 22 year olds in Thailand and claim it's proof that Java sucks. Congratulations.

    multiple, insideously incompatible with each other, versions of the so-called "universal" VM

    Yes, leaving aside the fact that Microsoft deliberately broke VM compatibility. Not just in one or two big ways. In a lot of little ways. As in on purpose. Great example. Very honest.

    There is a giant test suite. Gets better all the time. Reputable VM's pass it. Most of all, though, I just don't run into the cross-VM problem in the first place unless I'm doing 1.1 development for browsers, see above...

    We actually abandoned DB2 8.x release because noone could deal with the havoc the DB2 admin tools were causing with various other retarded banking related Java apps.

    There we go. The truth outs. You overpaid for a shitty product. Congratulations. You can do that in C or Fortran, too.

    Blame the language, though. Don't blame yourselves for picking a bad app.

    Oh well, time to have me shot on sight.

    Have a nice day.
  • by angel'o'sphere ( 80593 ) <{ed.rotnemoo} {ta} {redienhcs.olegna}> on Thursday September 30, 2004 @09:33AM (#10393544) Journal

    Java's garbage collection sort of creates a general laziness among some coders who don't clean up because they don't have to.

    This is a missconception of yours. In Java, you CAN'T clean up. In C++ you say
    delete x; x = null;
    , in Java you just say
    x = null;
    Probably I should correct my sentence above: freeing memory IS CLEANING UP, nothing else, so all Java programmers clean up automatically.


    All it takes is one pointer *ahem* reference to some object that contanis a reference to another, that contains an array... If you've got a few hashes and arrays in the way, it may be difficult to tell exactly where memory is being used, thus memory leaks.

    Well, for a GC that is not difficult to tell at all. Not harder as for a human :D
    In C++ somewhere somehow one had called delete. So at the point where in Java a hughe amount of memeory is referenced, and probably never used again, you have a dangling pointer in C++.

    but would what happen if two objects referenced each other but nothing else referenced them. Would gc know to follow the links between the two and see that nothing in the main app is using them?

    Of course, thats the point about garbage collection :-D

    If you have a memory leak in java then it comes from things like that:
    ArrayList vector = new ArrayList();
    while (someObscureEndlessLoopCondition) {

    vector.add(new SomeObject());

    }
    If you do somewhere something like this you will run into an OutOfMemoryException sooner or later .... but that problem is the same in all languages.

    It is really no difference if one "forgetts" a delete in C++ somewhere or one forgets a x = null; in Java somewhere, but the Java program won't crash indeterministic, thats a difference.

    angel'o'sphere
  • by Cederic ( 9623 ) on Thursday September 30, 2004 @09:55AM (#10393821) Journal

    Help me out here. Are you after a specifically IBM implementation of the Java VM for Windows, or is there another reason why you can't go to http://java.sun.com/j2se/1.5.0/download.jsp and download the Windows version from there?

    No intent here to flame, just curious about your reasoning..

    ~Cederic

  • by Anonymous Writer ( 746272 ) on Thursday September 30, 2004 @09:56AM (#10393843)

    Rather than mod you troll, here's a simple answer.

    I honestly wasn't trying to troll. If you walk into a computer store and look at all the off-the shelf consumer-level software products, they're all for Windows. I was hoping that Java would have changed this so that you can buy one of these off-the shelf products and run it on any platform. I know that it has gained acceptance at the enterprise level, I was actually referring to the consumer level.

  • by NightWhistler ( 542034 ) <alex.nightwhistler@net> on Thursday September 30, 2004 @10:02AM (#10393902) Homepage
    Depends on what you define as paradise really... around here we "lovingly" refer to the VS.NET Gui builder as "The Blob Generator". All you anti-patterns folks, you know what I mean.
  • Re:Is it C# yet? (Score:3, Insightful)

    by jonabbey ( 2498 ) * <jonabbey@ganymeta.org> on Thursday September 30, 2004 @10:15AM (#10394056) Homepage

    A C# fan accusing Java of copying?

    Excellent. Go Sun, Go!

  • by JUSTONEMORELATTE ( 584508 ) on Thursday September 30, 2004 @10:17AM (#10394079) Homepage
    Java is as far above C as C is above Assembly.
    I was about to mod this as Funny, but then I realized that you weren't making a joke.

    Back in the day, the tagline was "C -- all the speed of assembly, with all the programming ease of assembly."

    --
    Free gmail invites [slashdot.org]
  • by BigGerman ( 541312 ) on Thursday September 30, 2004 @10:18AM (#10394099)
    The biggest problem with Slashdot Java flaming is that people do not realize what Java is.
    If you compare language to language, say Java to C, C# or even Ruby and Python, it is easy to see why Java is "slow" and "bloated". But Java is to be compared to something like .NET and not just a language.

    Java is a platform. Java provides on-the-fly class loading and verification including digital signing of the code, very fine-grained security model (you can create your own sandbox with whatever security rules you want), first-class GUI (fast and responsive if you know what you are doing), tons of class libraries, enterprise APIs (which, minus ill-fated EJBs, are very popular), crypto and much more.
    So the only "other" platform of similar mugnitude is .NET and this is what you need to measure Java against.

  • by vegetasaiyajin ( 701824 ) on Thursday September 30, 2004 @10:24AM (#10394175)
    Java was a good, simple language. You may not have liked it, but you couldn't deny it was a simple language with an elegant C-style syntax.
    Now they added a lot of features that are nothing but crappy compiler sugar. Most of them badly implemented.
    1. Generics: They couldn't make it worse here. You cannot use reflection effectively because the type parameter information is not stored in the compiled class file. There are many ways to circumvent the type "safety" provided by the templates, especially if you are mixing code from older versions. This is one of the worse implementations of generics I have seen. I hate Microsoft with a vengeance, but they are implementing generics in a sensible way in the next version of C#. See this [artima.com] for an interesting discussion comparing Java, C# and C++ generics.

      With java generics you can compile this:
      class MyClass<T> {
      T[] anArrayOfT()
      {
      Object[] arr = new Object[10];
      //add whatever you want to arr.
      return (T[]) arr;
      }
      }
      Of course, you cannot assign the return value to a T[] because it is really an Object[], so, where is the type safety? All this is without mentioning that Java generics don't provide any performance benefit (which you would naively expect because you believe that you do not have to cast anymore).
      Java generics are just compiler sugar for automatically generating casts.
    2. Autoboxing: this feature removes clarity from the language. You do not know what is really going on. And you never know when you are going to be surprised.
    3. Enums: They coud have made a very good typesafe implementation using internal integer values orsomething simple like that. Instead they make them as clases. At first they look like they work fine, but if you start workking in contexts where several classloaders are used (e.g. application servers) then the enum is going to be loaded in both classloaders and comparison of apparently equal values will fail.
    4. Annotations: I really don't see the point of this. It's just more complexity. It seems it is only useful to help some complicated and probably not very well desinged tools.
    5. New for: This simply makes the code harder to read. The original, C like "for" construct was very clear and was very understandable both for arrays and collections. Now in order to use a fundamental construct (a "for") your code has to implement some new interfaces. This is pure crap.
    6. Static imports and variable length parameter lists: I think these are well done. I have nothing against these.
    7. It looks like they wanted to add novelty features, but in order to avoid make the appropriate JVM specification changes, they implemented everything as compiler sugar. It just doesn't work.


    8. Maybe the fact that Java is now managed by a comittee instead of a few people who do know about language/compiler design has something to do with this.

      Maybe they are just trying to make it "easier"for those who don't know how to program. Again, it doesn't work.

      Something more or less like this happened when C++ was standarized. They came up with an overly complicated monster language, but at least the specification was not a broken one, just complex.

      They could have added pass of parameters by reference (at least for primitives), which would have been very useful in real world situations. But instead they decided to add a ton of crap.

      Java is doomed now. Too bad it was my favorite language. Now I have to look for another language. Maybe D [digitalmars.com]?
  • by Jason Hood ( 721277 ) on Thursday September 30, 2004 @10:24AM (#10394177)
    Over 50% of the .Net libraries have not been ported to Mono and may never be. Mono is pretty cool but until it is fully ported it will remain years behind Java and .Net. You cant compare them like you cant compare java to perl. Java and .Net are very much competitors and will continue to dominate the industry in their niche. Companies need security (as in a future) for their multimillion projects. It took Java ~6 years to self promote. If Mono severely ramps up their efforts, they MIGHT reach the plateau. Java was first to the punch, which is a huge advantage. I would wager my hunting dog that Mono will not overtake java in the next ten years. If MS is lucky and throws enough money at .Net, it has a decent chance.

    You dont see companies developing 5k class projects in Mono, but thousands (if not more) do with Java and .Net. Dont believe me? Go count job postings for programming at Monster in a city near you.

    My city last month?
    60% Java
    15% Perl
    10% C/C++
    5% .Net
    5% COBOL
    5% other

    I cant hire Java and Perl programmers fast enough.
  • Re:Passe... (Score:1, Insightful)

    by Anonymous Coward on Thursday September 30, 2004 @10:29AM (#10394255)
    Uhh...Java of course borrows heavily from C and C++, but the language fixed so many problems with C++ objects and C pointers. The requirement for JIT forces certain simplifications into the language and these turned out to provide a more complete and useful language set than the free-for-all that C provides. I personally enjoy the free-for-all in C as it offers the best chance (aside from assembly) to explain to the compiler exactly what you want to do from a performance perspective while Java makes the creation of user interfaces and simple, non-performance critical applications simple and safe to express.

    Awkwardness in syntax? Sorry, just don't see it and haven't heard any legitimate complaints. No, it's not Visual Basic because it actually has to do something. The virtual machine that is provided in Java is generic and a simple environment to code in. The language tends to enforce decent coding style due to the VM restrictions (no odd pointer dereferencing/wordsize assumptions).

    If you are really looking for C/C++, you can always leverage the native integration that has been available since day 1 to ease the migration to the Java platform.

    Hats off to K+R for C is appropriate, but don't revise history by thinking that Java was developed in in vacuo of other languages. It stood on the successes of C and C++ and closed up language holes by providing a better class/inheritance/object representation.

    A.C.
  • Exactly (Score:3, Insightful)

    by Trejkaz ( 615352 ) on Thursday September 30, 2004 @10:37AM (#10394352) Homepage
    And not only was it faster to write in the first place, but the chances are your app will run on Windows out of the box without having to add arbitrary WinSock calls around the place. And it will run on BSD without adding extra network headers and libraries to the makefile after discovering half of them are missing from the default. And it will run on OSX without any knowledge of that platform at all. WORA is indeed real until people try to break it with specifically crafted examples. :-)
  • Re:Passe... (Score:1, Insightful)

    by Anonymous Coward on Thursday September 30, 2004 @11:01AM (#10394706)
    It's a bit annoying, yes, that autoboxing is required to use primitives with collections, but that was going to be a problem irrespective of whether generics were implemented at all.

    Why? ML manages generic collections perfectly well without wrapping everything in an object.
  • Re:Rapid learning (Score:5, Insightful)

    by tdrury ( 49462 ) on Thursday September 30, 2004 @11:05AM (#10394767) Homepage
    Sir, I regret to inform you that you've demonstrated "critical thinking" within a hostile forum. You are no longer allowed to read Slasdot. Move along.

    Joking aside, it kills me to see the amount of research and due-diligence that goes into debunking a Microsoft-sponsored benchmark, but when it comes to Java most everyone starts spouting nonsense. People will remember their experiences from 8 years ago, or a bad app, etc. and immediately conclude that Java must suck for every conceivable application.

    Java is a tool - no more, no less. Use it where you think it is useful and leave on the shelf if you don't think it will help solve your current problem. Most mature developers know when and where a tool should be applied.
  • SLOW (Score:3, Insightful)

    by Surt ( 22457 ) on Thursday September 30, 2004 @11:22AM (#10395054) Homepage Journal
    Bah, each new release I try hoping they'll do something about the speed since I like the language better than c/c++.

    Since 1.0 there have been three major speed holdbacks preventing me and many others from adopting java:

    1) array access too slow due to boundary checking (no, their optimizer doesn't work for my cases, and this is a problem a lot of scientists/performance hungry people have).

    #1 has some good solutions on 64-bit platforms developed at the university of georgia, but sun won't include them, nor will they enable a flag on the jvm to turn of bounds checks. GCJ lets you do it, but can't compile everything I need yet.

    2) casting raw memory to objects requires a copy. Java needs a structured object without a header to overcome this, such as the struct proposal, which is in the top 25 rfe's yet has no comment from sun.

    #2 has a well understood solution that sun is apparently too lazy to even consider implementing.

    3) No way to do fast 2d/3d rendered graphics. Too many call overheads & copies.

    Sun needs to ditch AWT/Swing, and probably needs to open source java to overcome this. They've proven their inability to keep up a reasonable mapping to modern featuresets.

    I'm probably going to have to give up and learn c# since I'd like a more modern language with good tools, but java just doesn't have the speed.
  • Re:Swing on OpenGL (Score:3, Insightful)

    by LDoggg_ ( 659725 ) on Thursday September 30, 2004 @11:23AM (#10395069) Homepage
    The openGL feature is really cool.
    Any idea if there's a way to turn this on or off programatically?

    Having this on the command line is ok, but if someone is using Mesa3d(software openGL on Linux) instead of hardware acceleration, it will be slower than the default rendering path of X11.

    Here's [cox.net] a screenshot of my JTurtle [cox.net] application running on accelerated openGL with jdk1.5 and using the new look and feel.

  • Re:I love the hate (Score:3, Insightful)

    by IgnoramusMaximus ( 692000 ) on Thursday September 30, 2004 @11:40AM (#10395354)
    First a disclaimer, I wrote the original post you seem to quote. I do not write Java apps and although I was mostly facetous, here is why I said those things:

    there are a thousand "super-efficient" .jar libraries required by a "Hello World" app

    No.

    Well it certainly feels that way when you try to load those apps. They all have excruciating startup times. Perheaps I am wrong and instead they check the integrity of my bank account or weather in China for my convenience. I dont really care, but 5-6 seconds of startup for a few boxes of interactive input is not really acceptable.

    it takes 12 objects instantiated in 4 containers to flip a bit in a byte

    Oh, I see. You're flipping bytes.

    I do not write Jave apps but I am quite familiar with OOP and also with the great zeal Java disciples apply it to everything. Like every other paradigm, one-size-fits-all applied to extremes allways results in the effects I described. My comment was to illustrate that if you go nuts and have hundreds of objetcs, events and containers all over the place, you are bound to end up with huge overhead. This is not restricted to Java by any means and many a C++ library suffers from the same issues. Java from what my (cursory I admit) glance at the language/libraries takes this to just such extremes.

    there is the substitution of native performance of compiled code to code compiled "Just Too Late" combined with exceptional memory usage that entails

    The "Just Too Late" was just a pun on the hype JIT is endowed with. The memory requirement (if you had read the thread where the original post was made) was confirmed by just about anybody including those who advocate Java. As I explained in there, if you have a 10-15 meg per JRE + 10-50 (memory managment seems to suck badly for the apps we use) per instance of an application (no way an OS can share DLLs or .so's here) in a multi-user environment, and this caused by 4 lines of input, ridiculous e-commerce apps, one has problems. Remember, I am not a Java theorist. Merely a user of apps written in your favourite cure-all language.

    multiple, insideously incompatible with each other, versions of the so-called "universal" VM

    Yes, leaving aside the fact that Microsoft deliberately broke VM compatibility. Not just in one or two big ways. In a lot of little ways. As in on purpose. Great example. Very honest

    I dont care who broke whose toys. As far as I (the user) am concerned, the whole Java thing is an umanagable, deployment and maintenance-wise, mess. If I am forced to let people download and install JRE's du-jeur for each e-commerce craplet out there, this is far worse then any other "client side" app. Also as I indicated in my posts, all of these Java apps fail miserably because their purpose can be accomplished by much simplier and more reliable means: plain HTML with smart server-side processing. That would mean no client-side pandemonium for anyone. Java was hyped as a soultion to deployent of seamless, headache-less OS independent client side apps, and in my user experience it turned out to utterly fail in this area.

    We actually abandoned DB2 8.x release because noone could deal with the havoc the DB2 admin tools were causing with various other retarded banking related Java apps.

    There we go. The truth outs. You overpaid for a shitty product. Congratulations. You can do that in C or Fortran, too.

    Besides rather flippant attidude, your thinking is simply wrong. Not only I have this problem with DB2, others have with Sun (Java's maker) admin tools and Oracle DB tools. But all of this is besides the point because the main place we use Jave in is also crap. Crap in many smelly varieties from many sources. While you might be a guru capable of writing 3D games and Self-conscious AI systems in Java, this is not what Java was advertised to us poor business sods for, and that which it was advertised for noone seems to be able to make work. And that is all I care about. Unfortunately for you, as I mentioned in another post, we the users will have the final word on this, not you in your Java 3D castle Mr.Java Wanker. Trust me on this one.

  • Re:5 or 1.5? (Score:1, Insightful)

    by Anonymous Coward on Thursday September 30, 2004 @12:14PM (#10395527)
    Fairies have wings, not tails.

    No, no! Fairies wear boots!
  • Sugar != Bad (Score:3, Insightful)

    by alacqua ( 535697 ) on Thursday September 30, 2004 @12:17PM (#10395578) Homepage
    Carrying on down this path much farther, you become able to argue that C is just syntactic sugar for assembly language, and therefore assembly language is just as good.
    Actually, except for the standard assumption that sytactic sugar [wikipedia.org] be an extension of a core language (and not a completely separate language), it's pretty much true that C is syntactic sugar for assembly language. But syntactic sugar is neither good nor bad in-and-of-itself. If a given instance makes programming easier to do and easier to understand then I'd say it's good.
  • by Anonymous Coward on Thursday September 30, 2004 @12:40PM (#10395839)
    Ah, you're referring to the python GC extension in which you can do some cyclic checks by subclassing from a gc object at the expense of a special GC flag that is added to the normal overhead of your classes?

    First of all, there's nothing particularly optional about Python GC. It is compiled in by default. I don't even know exactly how to disable it. It's not a configure script flag.

    Secondly, the "special GC flag that is added to the normal overhead of your classes" is just a bit flag (Py_TPFLAGS_HAVE_GC) that is OR-ed into the tp_flags field of a type struct in C. What overhead are you talking about?

    Of course, most people write their Python classes in Python, so they don't need to fiddle with bit flags to benefit from Python's GC. The builtin Python types have this flag enabled, including object, the base type of all new-style classes.

    The grandparent comment has a link to the gc module, which merely allows Python programmmers to set some parameters on the garbage collector. Just out of curiosity, is there any such package/class in Java?

  • by cbiffle ( 211614 ) on Thursday September 30, 2004 @12:57PM (#10396072)
    I both do and do not agree with this.

    The new for loop most certainly is syntactic sugar. It's taking something we could do before and shortening it into a new construct.

    However, a lot of folks use 'syntactic sugar' as a derisive term. It's not. It saves programmer time. Generally the times that it's bad are when it's (a) hiding what's really happening to a degree that introduces bugs, or (b) misguided, like SQL's attempts at being English-like.
  • by Kenneth Stephen ( 1950 ) on Thursday September 30, 2004 @01:00PM (#10396128) Journal

    Generics in Java have a smaller scope, when compared to C++ templates. The objective in Java is to provide a type-safety mechanism for containers. In C++, it is much more than that. Unfortunately, it is this extra ability in C++ that makes for some really complex code. Not sure if this has already been mentioned in this story, but it has been theorized that C++ templates are themselves turing complete (though I havent seen a proof to that effect).

    I'm a bit puzzled by all the generics nay-sayers. I have tried out the feature, and they augment the language. I have yet to see a downside to this feature in Java (unless one counts the inability of the compiler to fully utilize the additional type-safety in compiler error messages). What is all the flap about?

  • by Bitchslap_69 ( 732047 ) on Thursday September 30, 2004 @01:00PM (#10396146)
    You're confusing development tools with the language and platform. I can say the same thing about developing in Java with IntelliJ (or Eclipse if that's your thing) and a J2EE app server. All kinds of fun stuff to work with in there, but it doesn't affect the basic characteristics of the language itself.

    Don't get me wrong, I like C#/VS.Net quite a lot. But it's a different animal. I can run Java apps anywhere (yes, you can run .Net apps on Linux, but sorry, it's not an official part of the release and is reminiscent of the old Blackdown ports of the JDK/JVM: interesting, but not ready for production), while C# has some great aspects and a bit niftier development environment (I like IntelliJ better for what it does, but there are more tools in VS.Net). But basically C# only overrides Java if you're platform-dependent and I'm not even sure about then.

  • Not really. (Score:5, Insightful)

    by BayBlade ( 749886 ) on Thursday September 30, 2004 @01:04PM (#10396192) Journal
    I've opted to reply to this rather than mod.
    While I think "write-once, run-anywhere" is a bit of a misnomer, it does actually live up to the hype, imho.

    You can't really appreciate it however, until you've spent weeks porting C code between platforms, and a few hours porting similar Java code.

    I've had headaches porting perl too (though I must admit its much better now). Things these days are much better for people *trying* to develop cross-platform applications in Java and a number of other languages and APIs, but when it gets sprung on you as a requirement late in the game (latter revisions, new customers, etc) porting a Java app is a godsend.

    There's alot of valid reasons to hate any language (I've studied 22 languages and in their own way, I think they all suck), but that particular reason doesn't apply to Java.

  • Re:I love the hate (Score:3, Insightful)

    by greg_barton ( 5551 ) * <greg_barton@yaho ... m minus math_god> on Thursday September 30, 2004 @01:17PM (#10396382) Homepage Journal
    it takes 12 objects instantiated in 4 containers to flip a bit in a byte

    I'd love to see a code example for that.

    Here's mine:
    byte aByte = <some value>;
    int indexToFlip = <some value>;
    aByte = aByte ^ (1 << indexToFlip);
    Leave the declarations out and it's one line. Regardless, there are no objects or containers involved.

    Are the rest of your assertions so flimsy?
  • Re:Passe... (Score:3, Insightful)

    by rreyelts ( 470154 ) on Thursday September 30, 2004 @01:30PM (#10396561) Homepage
    Every cast operation in Java is expensive
    I have my own fair share of criticisms to level against Java Generics (no support for primitives, no type reification which leads to bastardisms like Class<T> and limitations like no new T[], etc...), but the cost of a cast has to be the worst criticism I've heard yet to date. A cast is implemented as a single VM instruction (checkcast) which generally takes nanoseconds to execute.
  • Re:I love the hate (Score:3, Insightful)

    by Featureless ( 599963 ) on Thursday September 30, 2004 @02:03PM (#10396982) Journal
    In other words, it's possible to write shitty code in either Java or another Object Oriented language, so it's off to the firing squad for everybody!

    Stand and salute the logic!
  • by StormReaver ( 59959 ) on Thursday September 30, 2004 @05:08PM (#10398918)
    "...if you forget to nullify references to objects you no longer use, the garbage collector obviously cannot reclaim that memory.."

    That's the whole point of the garbage collector:

    a = new Class1();
    a = new Class2();

    The Class1() object will be picked up by the garbage collector and deleted (assuming the garbage collector is not broken).

    a = new Class1();
    a = null;
    a = new Class2();

    This defeats the purpose of having a garbage collector.
  • by joib ( 70841 ) on Thursday September 30, 2004 @06:05PM (#10399417)

    a = new Class1();
    a = new Class2();

    The Class1() object will be picked up by the garbage collector and deleted (assuming the garbage collector is not broken).


    Oh good grief. Isn't that blindingly obvious? Apparently not...

    Perhaps I should have clarified my original comment by saying something like "nullifying references to reachable objects you no longer use", considering that my comment got, uh, about 10 responses which all totally missed the point. *sigh*

    Yes, in most cases nullifying references is not needed since the application is usually designed so that objects go out of scope when they're no longer used. However, in certain circumstances that approach might not be enough.

    Consider a situation like, say:
    a = new SomeHugeClass(); // some very big object
    b = a.doSomething();
    a = null;
    if (doSomethingElse(b)) {
    a = new SomeHugeClass("foo");
    } else {
    a = new SomeHugeClass("bar");
    }
    Now, if doSomethingElse() takes a long time to finish (say, doing i/o or a heavy calculation etc.), or requires lots of memory, it might not be a bad idea to first nullify a, as in the example above.

The rule on staying alive as a program manager is to give 'em a number or give 'em a date, but never give 'em both at once.

Working...