Slashdot Mirror


Have a Nice Steaming Cup of Java 5

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!"

47 of 859 comments (clear)

  1. Thanks to our supporters by NoInfo · · Score: 5, Funny

    "This release was made possible by our world-wide development community.

    Oh, yeah, and ridiculously large settlement payments by Microsoft."

    1. Re:Thanks to our supporters by Anonymous Coward · · Score: 5, Insightful

      I hate to say this, but:
      your cut is the fact you can use it for free!

      A. Coward

    2. Re:Thanks to our supporters by Anonymous Coward · · Score: 4, Funny

      You forgot to add "Netcraft confirms it - Java is dying" onto the end. But not a bad effort for a beginner troll.

  2. I wait! by orangeguru · · Score: 5, Insightful

    I wait for the first bug reports ... and version 1.5.1 ...

  3. Finally! by arhar · · Score: 4, Informative

    I've been waiting for this for a long time! Now waiting for Eclipse to release a working plugin (well, there's this ,but it's not that great.

  4. Java is to C as ... by SamSeaborn · · Score: 4, Interesting
    Java is as far above C as C is above Assembly.

    Microsoft was right to be afraid, developing in Java is a delight.

    Sam

    1. Re:Java is to C as ... by sbrown123 · · Score: 4, Interesting

      Object orientation is a terribly inefficient way to program.

      OOP advantage is best seen in large projects. Particullary collaborations. I've worked on large codebase non-OO projects before and know the headaches.

      Also, what about compile times and the fact that Java actually doesn't work on all interfaces?

      Dunno. What interfaces are you talking about?

      Compile times? Java's pretty speedy compiling. Than again, I dont have a 286. Will say this though: Make is a hell of a lot quicker than Ant. Ofcourse you could always use Make for building java though.

      (And as a side note, I don't like the fact that you have to type four lines of code to do what C++ could do with a simple cin >> var;

      in Java would be:

      System.in.read(var);

  5. How long will the MacOS X release take? by Offwhite98 · · Score: 5, Interesting

    After they took all that time to rewrite it with the latest API they claim they can closely track Sun releases. This will be the first big thing since then, so it will be a test of Apple to get it out quickly.

    --
    Brennan Stehling - http://brennan.offwhite.net/blog/
    1. Re:How long will the MacOS X release take? by Cederic · · Score: 5, Informative

      >> what is the point in coding in Java if it won't work on the #2 desktop OS?

      Perhaps because it will work on the #1..n server OSes?

    2. Re:How long will the MacOS X release take? by BorgCopyeditor · · Score: 4, Funny

      Shouldn't that be: "Hot Tiger-on-Tiger Action"? The spokesmen will of course be Siegfried and Roy.

      --
      Shop as usual. And avoid panic buying.
  6. Passe... by gowen · · Score: 5, Funny

    Don't you know, we don't hate Java anymore. These days we all love Java due to its major new feature -- its not C#

    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    1. Re:Passe... by spellraiser · · Score: 4, Interesting
      Yes, it's not C#, but it is getting closer and closer to being C/C++ (or something very very close). For instance, Java 5 borrows features heavily from C. Just take a look at some of the new features:

      - Generic Types (AKA templates)
      - Enumerated Types
      - Static Import (usage of this looks quite similar to the #define method)
      - Formatted Output / Input (printf/scanf style)
      - Varargs

      I like this trend. These, among other changes in version 5, are all steps towards reducing the awkwardness in the Java syntax that many people complain about. Java is a young, evolving language that still has a lot of potential.

      It is a bit funny, though, that this evolution takes the form of borrowing stuff from an ancient language. Maybe C just got things right in the first place, huh?

      /me puts on a flameproof suit

      --
      I hear there's rumors on the Slashdots
    2. Re:Passe... by mmusson · · Score: 4, Interesting

      I was actually looking forward to templates in Java but was disappointed once I saw the implementation of generics.

      Every cast operation in Java is expensive because the VM invokes security code to verify that the cast is legal. Java generics don't allow you to avoid the implicit cast so you still get the performance hit. Generics only make the code look cleaner.

      Template meta-programming is also a very important part of the modern C++ libraries and is also something that generics cannot do.

      --
      SYS 49152
    3. Re:Passe... by Jon+Pryor · · Score: 5, Informative

      My apologies for the horrible look of the code samples. Slashdot won't let me use nice, short lines, as it results in lines which are too short. Gah! Apparently I need ~40 characters per line (average) to get past the @#$% filter... This has to be the most annoying filter I've ever come across; I've spent more time getting past the filter than responding to your question!

      Iterators are similar to java.util.Iterator. C# iterators are compiler support for implementing the System.Collections.IEnumerator interface. For example, in Java you'd write:

      public class MyIterator implements Iterator {
      private String[] hw = {"hello", "world"};
      private int pos = 0;
      public boolean hasNext () {
      if (pos >= 0 && pos < hw.length) return true;
      return false;
      }
      public Object next () {return hw[pos++];}
      public void remove () {throw new UnsupportedOperationException ();}
      }

      public void UseIterator ()
      { Iterator e = new MyIterator ();
      while (e.hasNext())
      System.out.println (e.next().toString());}

      C# iterators make this much easier:

      public IEnumerable SayHello ()
      { yield return "hello";
      yield return "world";}

      public void UseIterator ()
      { foreach (string s in SayHello())
      Console.WriteLine (s);}

      C# iterators are particularly useful when implementing your own collection objects. Google for them; they're very powerful.

      Anonymous Methods are methods without a name, just like Java anonymous classes are classes without a name. Same basic idea, fewer braces. They also act as full closures; while Java requires that all stack variables referenced from an anonymous class be final, C# doesn't require this.

      int n = 42;
      EventHandler h = delegate {Console.WriteLine ("something happened:" + n);};
      h ();

      The above example is bad, but you can let your imagination run wild. This is very useful for event handlers.

      Partial Types

      allow you to split a single class definition across multiple files. This is useful to prevent > 50 KB source files (yech!), and makes it easier to have part of a class machine generated (by a GUI builder) and part hand-written. Some people hate it, others are ambivalent, but it can be handy:

      // File a1.cs
      partial class Foo {public int a;}

      // File a2.cs
      partial class Foo {public int b;}

      Nullable types are primarily useful for database support in the .NET type system. DB types can be "nullable" -- not present. For reference types, this is easy -- use null. For .NET value types, this isn't possible, as value types can't be null. The solution is to introduce a generic class System.Nullable<T>, which can wrap value types such as int.

      The C# compiler adds syntactic sugar to this, to simplify usage:

      int? nullable_int = GetMyNullableInt ();
      if (nullable_int.HasValue) /* use nullable_int */

      Nullable types are more special purpose, but are useful for those who need them.

      Ignore the rest of this: it's just garbage to get past Slashdot's wonderful "too few characters per line" problem: lk jfjdlkajdsfl;kja sdfl;kja fjklsafjd l;kj lasjd lkjds fl;kja sdflkajsd lkj afs lk jfjdlkajdsfl;kja sdfl;kja fjklsafjd l;kj lasjd lkjds fl;kja sdflkajsd lkj afs lk jfjdlkajdsfl;kja sdfl;kja the quick brown fox jumps over the lazy dog l;kajdsfl;kj;lkj l;kjasdilfj l;kjoiewqruq[op 0-9314u75 lkfjx ;lkajdsfmopiac un0p3u5n1-0329u kl 0a9u 3214o5ilj hello out there in tv land! q 09

    4. Re:Passe... by Baki · · Score: 4, Informative
      In Java5 you would write the C# iterator just about the same.

      For example

      for (Shape tShape : pList) {
      System.out.println("X is " + tShape.getX());
      }

  7. J2EE --> 1.3.1 still by tezza · · Score: 5, Interesting
    If you develop apps targeted at Websphere 4, say, they're still 1.3.1 spec.

    I look longingly at typed collections to save yet another ClassCastException on anonymous iterators. *sigh* oh well, maybe 6 years from now...

    --
    [% slash_sig_val.text %]
  8. I just got my copy... by melted+keyboard · · Score: 5, Funny

    Now let the slashdotting commence!

  9. Release notes by BlurredOne · · Score: 5, Informative

    If any one is interested in reading the release notes, they can be found at http://java.sun.com/j2se/1.5.0/docs/relnotes/featu res.html

  10. Stealing my tongue by mukund · · Score: 4, Funny

    I, for one, welcome our new virtual machine overlord.

    Dude you know you are not supposed to say these things in the story itself.

    --
    Banu
  11. useful or bloat? by N3wsByt3 · · Score: 4, Interesting

    Well, some may call the 1.5 as being increasingly bloatware, but, why in some aspects this may be true, I think all by all there are considerable improvements over the former releases, especially 1.4.2.

    JVM 1.4.2 (at least some sub-versions) were riddled with bugs, which, for instance, become apparent when people use systems that rely on it in a special way, as with Freenet. It comes as no surprise, that there were numerous reports of some errors on OSX and BSD, as well as on linux, when running JVM 1.4.2. For some time, we had to say "If you experience any difficulties, please try/revert to JVM 1.4.1 or 1.5.x and see if that solves the problem."

    It is crazy to recommend reverting, but the main devls of java were unwilling to remedy the bugs in 1.4.2, claiming it was a Freenet-problem, while our devls said it was a JVM problem. Though it must be said some within freenet claim their is little to no problem with it (probably windows-users, or maybe some sub-versions that worked on specific linux-distributions). Anyway, my advice has always been, and will be (certainly in the light of the stable 1.5 release), to NOT use the 1.4.2, especially when using OSX or another 'nix based OS.

    And also; be sure to get the JRE, and not the full SDK, unless you plan to develop Java software.

    --
    --- "To pee or not to pee, that is the question." ---
  12. The new for loop and type safe collections rock by ShatteredDream · · Score: 5, Informative

    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 when you are iterating over a collection or an array. The type safe collections are also very handy--no more class cast exceptions and stuff like that.

    It would be nice though if Sun would make Groovy or Jython a standard part of their java distribution. That would definitely make it competitive with .NET

    1. Re:The new for loop and type safe collections rock by DevCybiko · · Score: 5, Insightful

      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?

  13. Re:Stability/memory leaks by MemoryDragon · · Score: 4, Interesting

    Actually no, it is an app problem. Sun has introduced weak references way back in 1.3 to cope with that problem. And I have to admit, I never had any of these problems since 1.3
    But it also could be that your program simply needs a tad more ram.
    Following, check out the -Xmx and -Xms parameters of your application startup file and add more ram (java fetches 32MB in without any params and fills it up before it starts the GC for the first time) That might help.
    But never count memory leaks out, they are very rare, but can happen if somebody has tangling references, pretty much the only case where the Garbage Collector can do basically nothing.
    The VM itself is not flakey, I have a few servers running here, with an uptime of a year already.

  14. The language wars never ceases to amaze me by nhnfreespirit · · Score: 4, Insightful

    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.

  15. Re:Still no operators... by timbloid · · Score: 4, Informative

    > ok, it got faster, but still not as fast as C++ too.
    > I guess this will finally come but when ?

    Errr...

    Java 1.4 was comparable in speed to C++ (except obviously for Trig which got a huge overhaul in 1.4 and slowed down some)

    It really depends how you write you code... Sloppy C++ code can be slow too.. ;-)

  16. Re:Stability/memory leaks by joib · · Score: 4, Insightful


    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..

  17. Bytecode Compatibility by Brian+Blessed · · Score: 4, Insightful
    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.
    1. Re:Bytecode Compatibility by Z-MaxX · · Score: 4, Informative

      You need to use the "-target 1.4" option to javac to tell it to produce the older version of class files.

      --
      Dr Superlove 300ml. I use my powers for awesome
    2. Re:Bytecode Compatibility by angel'o'sphere · · Score: 4, Informative

      (i.e. you can't have "-target 1.4 -source 1.5") . Yes, you can have it!
      But what about your classpath, does it reference the 1.5 JRE? E.g. if the 1.5 java.lang.String gets loaded by an old JVM you might get that errro as well.
      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:Bytecode Compatibility by julesh · · Score: 4, Informative

      I thought that the compiled Java would remain compatible with the bytecode format used by previous versions.

      The bytecode format is still identical. The version number on the file was incremented because classes that depend on assertions could break badly if used on a JVM that doesn't implement them (which is actually a feature of a few classes in java.lang, not a bytecode interpreter feature). Use the '-target' commands recommended by the other posters whenever producing code that doesn't rely on one of the new features.

  18. mod parent down by hruntrung · · Score: 5, Insightful

    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 ++.

  19. Re:5 or 1.5? by Cederic · · Score: 4, Insightful


    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

  20. Metadata is the coolest new feature in 5.0 by jg21 · · Score: 4, Interesting

    In an interview given just last night, the spec lead for 5.0 is asked what in his view the coolest new feature of the language is. Calvin Austin replies: If I just restrict myself to the language it would be metadata (JSR 175). We've only scratched the surface of its potential. For the platform, it's a bytecode insertion for profiling (JSR 163).

  21. Swing on OpenGL by tesmako · · Score: 5, Informative
    One of the new features of Java 1.5 that has not been mentioned much yet is the OpenGL acceleration of Java2D (which underlies Swing and AWT). Adding the flag
    -Dsun.java2d.opengl=true
    (or by setting the system property in the program) makes pretty much all Java2D calls go directly into OpenGL.

    This does indeed work too, I have played around with it and graphically intensive Swing applications really fly with OpenGL activated (given that your graphics card and drivers are sufficiently bug-free and modern). Read about it here

    And yes, it does work under Linux, and Windows and Solaris (and most likely will under OS X, though that is up to Apple to implement).

    Even without OpenGL acceleration the Swing responsiveness improvements are very impressive, coupled with the much better both default theme and theme mimicking in 1.5 I'd say it is time to retire the Swing troll.

  22. I love the hate by Featureless · · Score: 5, Insightful

    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.

  23. Eclipse 3.1 betas by trajano · · Score: 4, Informative

    The Eclipse 3.1 betas support 1.5 constructs. I normally use the integration builds.

    --
    Archie - CIO-for-hire :-)
  24. Re:Stability/memory leaks by angel'o'sphere · · Score: 4, Insightful

    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
    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  25. Ad seen on Monster today by phyruxus · · Score: 4, Funny

    Java Developer needed. Must have 3+ years experience with Java 1.5, to start immediately.

    --
    "A witty saying proves nothing." ~Voltaire
    "d'Oh!" ~Homer
  26. Okay, I'll Bite (a.k.a. "A Java Flame") by mattdm · · Score: 5, Interesting

    I work on a minor, highly targetted Linux distribution. I'd love to include Java, and I actually get a lot of requests for it. But, here's an excerpt from the license agreement you'll find if you look to download the software:

    B. License to Distribute Software. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the Software README file, including, but not limited to the Java Technology Restrictions of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software, (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that protects Sun's interests consistent with the terms contained in this Agreement, and (vi) you agree to defend and indemnify Sun and its licensors from and

    (Yes, it really does just end abruptly without finishing the sentence. That trailing "and" there doesn't lead into the next section; it's just not done. Obviously I'm the only one who bothers to read these things -- *including* the people at Sun. Anyway....)

    My wish to give the software to my users fails almost every test....

    i: I don't want to distribute it for the "sole purpose of running [my] Programs". I want to distribute it so people can run other people's programs, including possibly their own.

    ii: uh, well, actually, my "Programs" don't add any functionality to Java, let alone "significant and primary".

    iii: oops, I include gcc, which has a Java compiler. And I'm definitely not going to drop that.

    iv: ahh, now this one I can agree with -- fine keep your copyright notices, etc.

    v: my distribution as a whole is under the GPL. I'd have to run this by our lawyers, but this looks like it'd conflict by requring additional restrictions (even if I could get special dispensation to deal with the other issues).

    vi: I don't really have the resources to defend and indemnify Sun "from and", even if I wanted to, thanks.

    And frankly, that's why I wish people would stop writing things in Java. It's a pain to deal with. I want to make everything as slick, integrated, and as easy as possible for my end users. Sun makes that impossible for Java applications. If you want your code to be easily integrated and made available to users like mine -- and really, that's users of any Linux distro targetted more broadly than the super-geek sector -- please don't use Java. If you must, at least design it to work with gcj instead of Sun's virtual machine.

    Unless Sun changes the license terms, their Java can never fill the "write once, run anywhere" goal -- but cleanly written source in an open language can.

  27. Rapid learning by GeekDork · · Score: 4, Interesting

    As much as I might hate Java, I repeatedly have to throw this one thing into the fray: I had exactly zero former experience with network programming, and still, I was able to produce a basic telnet-like application in under 30 minutes, using only the Java API doc and some logical thinking. And I only had a very brief introduction into the language. Transferring this to C (although the basic structure is exactly the same with BSD and Java sockets) took me about a week, with all those damn low-level error conditions.

    --

    Fight hunger. Filet a politician and send him to a 3rd world country of your choice.

    1. Re:Rapid learning by tdrury · · Score: 4, Insightful

      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.

  28. Re:I wait! -- you mean... by scovetta · · Score: 4, Funny

    You mean 1.5.1_03.1

    --
    Wer mit Ungeheuern kämpft, mag zusehn, dass er nicht dabei zum Ungeheuer wird. --Nietzsche
  29. Re:Dear Sun by iso · · Score: 4, Informative

    Why don't you try this?

    1) go to java.com
    2) click the big "get it now" button
    3) download the EXE

    Now quit trolling.

  30. Re:STUPID MODS by ElGuapoGolf · · Score: 5, Informative

    Are you aware that the vast majority of games you play on any phone (except Verizon phones) are written in Java?

    Thought not.

  31. Re:Stability/memory leaks by figa · · Score: 4, Interesting
    I ran into a fabulous memory leak just last week thanks to Sun. I wrote a client that was accepting messages and persisting them using ObjectOutputStream. I persisted about 40,000 HashMaps, and next thing, my client was using 200M. I wasn't building any lists of the messages, so I was stumped, and I broke out the profiler.

    I was surprised to find that the ObjectOutputStream has a static HandleTable inside it that creates an entry for each HashMap that I put through, and it keeps a reference to each HashMap. I searched around, and this is a common problem that is not mentioned at all in the javadocs. You're supposed to reset the ObjectOutputStream periodically to free up the HandleTable. I had assumed that reset was like InputStream's reset and never would have guessed that it had to do with Object caching in the stream.

  32. Generics != C++ templates by Kenneth+Stephen · · Score: 4, Insightful

    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?

    --

    There is no such thing as luck. Luck is nothing but an absence of bad luck.

  33. Not really. by BayBlade · · Score: 5, Insightful
    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.

    --

    The key difference between a Programmer and a Senior Programmer is that one of them is Mexican.