Slashdot Mirror


10 Reasons We Need Java 3

An anonymous reader writes "This article on O'Reilly Network (written by one of the most active Java book writers ever, Elliotte Rusty Harold) has some interesting points about the need for a new 'cleaned up' Java version, made to incorporate the advances in the last 7 years of its life and without the requirement to keep compatibility with old versions."

568 comments

  1. Forget It by JohnHegarty · · Score: 4, Insightful

    "without the requirement to keep compatibility with old versions"

    The only way this will work is if it is compatable with older versions. Would anyone upgrade to Borland Builder 6 if they were told they couldn't compile there previous programs.

    If it was compatable , then people could upgrade and start using in the morning.

    1. Re:Forget It by Anonymous Coward · · Score: 0

      Uh you obviously aren't old enough to remember the DOS days. I had tons of DOS programs that when I tried to run under WIN3.0 would crash crash crash. Same goes for WIN3.1 programs that i later tried under windows 95. Hey, even some windows 98 programs dont work under 2k or xp. So get yer head out of yer ass and READ THE ARTICLE, dont just try to get the first post.

    2. Re:Forget It by taeric · · Score: 1

      I agree to an extent. However, the keeping of deprecated methods seems unnecessary. Especially after several versions. I would be happy if the deprecated methods were kept for a few versions.

      Converting file formats to XML also sounds like a decent idea. Though, I believe this can pretty much be accomplished with JAXB already.

    3. Re:Forget It by JohnHegarty · · Score: 1

      Yes , there is problem. But a program designed for Windows 3.1 , in say Delphi , can be recomplied for Windows XP , without too many problems.

      Not so true for dos programs , but this is moving from an TEXT based system to a GUI. This java update is going to be running on the same systems with the operating systems with the same requrments.

    4. Re:Forget It by Y+Ddraig+Goch · · Score: 1

      Borland already does this! Just try to get a Delphi 1 App to compile under Delphi 6. Or for that matter a D5 app to compile under D6. Some of the problems are simple syntax others are changes in the philosophy of the language. For change to happen little used/un-usefull/klugey features MUST fall by the wayside, that's progress.

      --
      Meddle thou not in the affairs of Dragons, for thou art crunchy and with most anything.
    5. Re:Forget It by Anonymous Coward · · Score: 0

      Any how good is your second language ?

    6. Re:Forget It by Anonymous Coward · · Score: 0

      Something tells me that you don't remember the Win 3.1 and DOS days either since Windows 3.1 ran from the command prompt. If you needed to run a DOS application you just went right back into Dos 6.2 and ran the application. It didn't require any sort of rebooting and dual partitions.

      The best argument you have in there is the 9X move to the NT kernel OS's (2000 and XP). NT for stability purposes forces all hardware calls to go through the HAL (Hardware Abstract Layer). This is why certain hardware and software doesn't work properly.

    7. Re:Forget It by zmooc · · Score: 2

      I run a company that writes Java-webapps and would instantly upgrade if a new Java version would come up with the suggestions of the author. Especially the primitive types should be removed. They're so incredibly annoying. Besides, why would Borland Builder 6 not compile any older programs? It's not that hard to tell the builder what version of Java you want to use.

      --
      0x or or snor perron?!
    8. Re:Forget It by Silverstrike · · Score: 1

      The main problem with compatability isn't with compiling the code. While that is a concern, the most signifigant change would be the JavaVM. Since Java won't run natively on any given platform, the VM is what actually executes the code. A Java3 VM, as he describes it, wouldn't run any Java2 code. Big problems.

    9. Re:Forget It by Media+Tracker · · Score: 1
      The only way this will work is if it is compatable with older versions.

      I think it should be feasable to have a new Java which would require most programs to be recompiled, perhaps some to be slightly modified, just like the current switiching of Mac programs to MacOS X.

      The article author suggests several API changes; that means programs using the removed API elements will have to be slightly modified. In many cases it's be a search-and-replace job (this class "X" is now renamed "Y", method "a" is now known as "b", etc). Aside from that, several of the changes he proposes are VM enhancements which {w|sh}ould not influence current Java2 programs.

      I think the switch is feasible. I would definitely be a bigger step than Java evolution has ever made, and it would take time, but it would help. We could have VMs and plugins which would accept both binary formats, ideally.

    10. Re:Forget It by thomas.galvin · · Score: 1

      He's not talking about changing the philosophy of Java; he's talking about reworking Java so that it actually conforms to the Java philosophy. Simpler. More Powerful. More Consistant. That is supposed to be Java's mantra, but it doesn't always meet it. I love Java, but I'm also able to see that there is room for imporvment, for progress.

    11. Re:Forget It by sbrown123 · · Score: 1

      >>Especially the primitive types should be removed.

      There are many instances, such as streaming data I/O, that make this a very bad idea. Objects also take up alot more memory than primitive types. This larger memory requirement also effects speed as the computer has to manipulate larger amounts of memory.

    12. Re:Forget It by sbrown123 · · Score: 1

      That will not work if the code you write to check the version ever becomes incompatible with the jvm you launch it with.

    13. Re:Forget It by zmooc · · Score: 2

      Well...maybe they shouldn't be removed, but it should be possible to access them as normal objects. Because that's what it's all about in the end.

      --
      0x or or snor perron?!
    14. Re:Forget It by dasmegabyte · · Score: 3, Interesting

      Well, technically people are upgrading to VB .NET, which is wholly incompatible with VB 6.0. They are so different, and VB.NET is so unready as a passable alternative for application development, that I'm sure there's room in this space for somebody e.g. Borland to make a killing selling non-webservice, non-CLR based "Visual" development environments.

      A few things I've "recompiled" into VB.NET (it really is recompilation, nothing looks the same as VB.NET is a real object oriented language, or as close as it comes from redmond's "think/market-tank") look nothing like the originals. Tight loops I spent hours optimizing run five times slower. Stuff I didn't optimize is even slower than before. But I can kind of sign off on this -- it's so nice to finally have real constructors, etc.

      --
      Hey freaks: now you're ju
    15. Re:Forget It by foofboy · · Score: 1

      Do you use the primitive data types directly when streaming? Remember that the bytecode compiler and jvm are free to represent the data internally more efficiently if that is appropriate, there's no reason that the bytestream classes can't assume 8 bit chunks, but I like the python-esque "everything as an object" approach. And, yes I have done bitwise arithmetic in both C, Java and Python. However, as long as we're talking about streaming data I/O, I would love to see bytes become unsigned.

    16. Re:Forget It by Anonymous Coward · · Score: 0

      You aren't allowed to discuss benchmarks of the .NET runtime! You're in violation of your EULA!

    17. Re:Forget It by Anonymous Coward · · Score: 0

      Excellent.

      And my third language is pretty good, too.

      Though my fourth and fifth languages suck.

      And, yes, I am an American who spoke and understood nothing but English growing up.

    18. Re:Forget It by sbrown123 · · Score: 1

      >>Do you use the primitive data types directly when streaming?

      Yes. See InputStream and OutputStream. They use primitive types.

      >>Remember that the bytecode compiler and jvm are free to represent the data internally more efficiently if that is appropriate

      Primitive types are as efficient as you can get since they compile into bytecode as thier byte size.

      >> there's no reason that the bytestream classes can't assume 8 bit chunks, but I like the python-esque "everything as an object" approach.

      There are many scripting languages that have taken this approach. Java is not a scripting language but rather interpreted. There is a difference.

      >>And, yes I have done bitwise arithmetic in both C, Java and Python.

      Thats good but I have no idea how this supports your point.

      >>However, as long as we're talking about streaming data I/O, I would love to see bytes become unsigned.

      Since you know bitwise arithmatic in Java you should know this is not an issue.

    19. Re:Forget It by Thorin_ · · Score: 1

      Sigh, RTFA.

      The whole point of the article was that there are many things that could really use to be changed but arn't because they would break compatibility with older versions of java.

    20. Re:Forget It by SurfTheWorld · · Score: 5, Insightful

      From the article:
      This article imagines a "Java 3" that jettisons the baggage of the last decade, and proposes numerous changes to the core language, virtual machine, and class libraries. The focus here is on those changes that many people (including the Java developers at Sun) would really like to make, but can't -- primarily for reasons of backwards compatibility.

      In other words, Elliotte fully understands *why* his proposed changes would be difficult to implement. His 10 changes are contingent upon the assumption that you can break backwards compatibility.

      It doesn't seem totally unreasonable to me. Microsoft forces people to upgrade their OS in order to support newer versions of their Office product. While I'm definitely not a Microsoft advocate, I believe that forced upgrades aren't necessarily a "bad thing."

      Assuming Java 3.0 were implemented and backward compatibility was broken, Sun wouldn't pull the downloads for Java 2.0 off their websites. Moreover, a magical wave of energy won't wash over the planet halt'ing all Java 2.0 and 1.0 applications and permanently erasing their JDK installations. The 2.0 and 1.0 Java applications would simply become "legacy" code until such time that they are either replaced or updated to the new Java 3.0. In fact, it would not surprise me if a significant number of the apps were not migrated (because they were not judged important enough to spend money to upgrade) and continued to execute under the old Java.

      The authors of Java 1.0 and Java 2.0 applications didn't have the benefit of coding under the "3.0 conventions". If the applications they wrote could really benefit from the changes, the authors will go back and refactor. If not, the application will continue to run in it's current form for years to come.

      Upgrades are like refactorings. While toothless ones are trivial, they rarely provide significant benefit. It's usually the difficult upgrades (EJB 1.1 to 2.0?) that provide real opportunity for advancement. The 10 proposals by Elliotte seem like an example of the latter.

      --
      Do it for da shorties
    21. Re:Forget It by Anonymous Coward · · Score: 1, Insightful

      The CLR (Microsoft's .NET analog to the Java VM) loads a version of the runtime that corresponds with the version the assembly was compiled against. So you could have stuff running from multiple versions of the CLR on the same machine.

      If Java had a similar mechinism you wouldn't have to break compatibility. Now I'm not sure if the bytecode is decorated with the Java version, but I could see a similar soloution being used to keep legacy Java on life support.

    22. Re:Forget It by Jeppe+Salvesen · · Score: 2

      If they could make the JVM work with both java2 and java3, I don't think backwards compatibility would be the big issue. We would still have access to java2 compilers, but most of us would want to use java3 since it would enable coders to produce more code per hour.

      Java2 is awkward in some respects, not so awkward in other respects. It is certainly less clean now than it was when it was originally released - with all the bonus IO layers etc tacked on. Just look at the size of the source code for Java. All that backward compatibility needs to be maintained. I'd rather they cleaned things up and put their efforts into making Java3 work really well.

      --

      Stop the brainwash

    23. Re:Forget It by foofboy · · Score: 2, Insightful

      >>>>Do you use the primitive data types directly when streaming?

      >>Yes. See InputStream and OutputStream. They use primitive types

      Point taken. Let me clarify my stance. [In|Out]putStream should be implemented using hard 8 bit thingies internally, but that when I request a number of 8 bit thingies from the stream, I'd just a soon stuff them into a Byte (the object) as a byte (the primitive). But there shouldn't be Bytes and bytes. Since we are dealing with objects, lets just use objects. Needless to say, we'll need to use objects representing byte arrays, and so forth.

      >>>> there's no reason that the bytestream classes can't assume 8 bit chunks, but I like the python-esque "everything as an object" approach.

      >>There are many scripting languages that have taken this approach. Java is not a scripting language but rather interpreted. There is a difference

      I'm not sure I follow you. I can compile Python source into bytecode. The semantics of the language don't change. If you mean that Java is trying to achieve higher performance, well I'm not a compiler/VM author but the original article suggests that it's possible for the internal representation of objects to be quite close in size to their primitive counterparts (a simple matter of coding :) ). If true, and depending on the local value of "acceptible" the overhead may be acceptible.

      >>>>And, yes I have done bitwise arithmetic in both C, Java and Python.

      >>Thats good but I have no idea how this supports your point.

      I just mean that I've used all the languages, and am not comparing features of languages I'm not familiar with. I mean that I've been frustrated by the need to use Java like a half-assed C when dealing with byte sized chunks, when C's procedural approach is delightful and Python's pure object approach is delightful. Seems that they tried to provide pseudo low level access to bytes, when it might have been better to go as far down in abstraction as C or as high as python.

      >>>>However, as long as we're talking about streaming data I/O, I would love to see bytes become unsigned.

      >>Since you know bitwise arithmatic in Java you should know this is not an issue.

      Which is bigger, 0xFE or 0x01? When is 0x80 + 0x01 not 0x81? Having to manually compensate for two's complement representation gave me a big headache.

    24. Re:Forget It by Anonymous Coward · · Score: 0

      NOO! XML is horrible, bloated shit! Don't do anything that stupid!

    25. Re:Forget It by Anonymous Coward · · Score: 1, Funny

      Tight loops I spent hours optimizing run five times slower.

      Why would anyone optimize VB, let alone spend five hours optimizing one piece of code in it? (and presumably not in an "optimize the algorithm" way, if recompiling could affect it that much)

      I mean you might as well strap wheels on the snails in my garden...

    26. Re:Forget It by sbrown123 · · Score: 1

      >>But there shouldn't be Bytes and bytes. Since we are dealing with objects, lets just use objects. Needless to say, we'll need to use objects representing byte arrays, and so forth.

      JDK 1.4 introduced NIO. It has a ByteArray that wraps a true byte[] (actually it wraps a native void pointer in Buffer and just casts). When you deal with object I/O you should use the object streams: ObjectInputStream and ObjectOutputStream. There is a point of people complaining that they have to use the Number object wrappers (Byte, Integer, etc) around the primitive types to use them with the Collections API. This to me seems a rather moot point since you should use primitive arrays if you are only using primitive types since they are:

      (1) easily made thread-safe,
      (2) are much quicker, and
      (3) do not hog up as much memory.

      >> Seems that they tried to provide pseudo low level access to bytes, when it might have been better to go as far down in abstraction as C or as high as python.

      Java sits in an odd place. Going in one way or the other leads to issues.

      >>Which is bigger, 0xFE or 0x01?
      if (0xFE > 0x01)
      System.out.println("true");
      else
      System.out.println("false");

      Result: true. 254 is to large a number for the Java primitive byte. The "If" condition blocks defaults to using ints.

      >>When is 0x80 + 0x01 not 0x81?

      Is this a riddle?

      >>Having to manually compensate for two's complement representation gave me a big headache.

      Keep asprin handy at all times. I keep a full bottle right next to my keyboard.

    27. Re:Forget It by sbrown123 · · Score: 1

      I said "ByteArray" but it should have been called "ByteBuffer". Thank goodness for javadoc.

    28. Re:Forget It by dasmegabyte · · Score: 2

      Um, because sometimes morons write a huge codebase in VB using lots of string functions without considering whether strings are mutable or not? And then these guys pack up their certifications into their Saabs and leave to consult, so that us non-degree, sub 50k lackeys can support them as the application "scales."

      The particular algorithm I'm thinking of used a simple little array of shorts to store character codes which i then reorganized into a windows string. It was a damn elegant function that I've used all over the place...that's far and away my most included module. .NET "objectizes" the array and "objectizes" the shorts themselves. Suddenly, what had compiled into an itty bitty algy was a massive movement.

      And, to be honest, I don't really have to do this crap anymore with VB.Net. The StringSaver, or whatever MS called their ripoff of Java's StringBuffer class, does it all for me, no doubt faster than its recompilation of my code but slower than the one I built myself.

      VB ain't so bad if you don't make dumb mistakes like "adding" + string(s) + "and using Variants everywhere". But it's still a sloppy coder's dream. Give me Java any day of the week...except those days when I have to access the API!

      --
      Hey freaks: now you're ju
    29. Re:Forget It by digitalgiblet · · Score: 1
      If Java had a similar mechinism you wouldn't have to break compatibility. Now I'm not sure if the bytecode is decorated with the Java version, but I could see a similar soloution being used to keep legacy Java on life support.

      Here's a crazy thought... the new 3.0 version (or greater) would have a version number.

      Anything without a number would be run by the JVM in "legacy" mode.

    30. Re:Forget It by tgrigsby · · Score: 1

      I could see making compatibility a lesser priority if the Java team could resolve latency in serialization, transmission, and deserialization of objects, and rethinking the GUI classes (who was the dork that thought up layout managers?). Perhaps then people would re-embrace a language that burned them when they attempted to build and market client-server and multi-tier applications with it.

      --
      *** *** You're just jealous 'cause the voices talk to me... ***
    31. Re:Forget It by Herbmaster · · Score: 2

      The only way this will work is if it is compatable with older versions. Would anyone upgrade to Borland Builder 6 if they were told they couldn't compile there previous programs.

      You are completely misunderstanding the point of the article. Your comment is not insightful (nor is it informative).

      The author is calling for a new language. This new language is a lot like Java - so much so, in fact, that it should be called Java. But it would be incompatible with Java as we know it for reasons he describes and justifies in the article. This has 3 implications, none of which are relevant to the need for "Java3" to be compatible with traditional Java:

      • New Java compilers need to support compiling Java as well as Java3.
      • New Java VMs need to support running Java as well as Java3 bytecode.
      • Development on oldstyle Java VMs, compilers, and eventually programs, should eventually stop in favor of Java3.
      --
      I'm not a smorgasbord.
    32. Re:Forget It by Fussy+Part · · Score: 1

      I think you want to avoid as much as possible having your users download and install VMs. I have enough trouble trying to explain how to go to Suns site, and navigate through their maze of a website. Also, most people are still on dial-up, and they won't download anything over 10 megs if they don't need to.

    33. Re:Forget It by MrBoring · · Score: 1

      While your at it, why not make the version
      number a real 3.0 rather than 1.3.zzz something.

    34. Re:Forget It by JebusIsLord · · Score: 1

      In 5 hours you could rewrite a VB script in sloppy C++ and have it run much faster. Why on earth if speed is an issue do you use VB in the first place? VB is for quick-and-easy, not clean and efficient.

      --
      Jeremy
    35. Re:Forget It by Wavicle · · Score: 2

      When is 0x80 + 0x01 not 0x81? Having to manually compensate for two's complement representation gave me a big headache.

      Here's an easy way to remember it:

      0x80 + 0x01 is always 0x81.

      In non two's complement, it's obvious: 128 + 1 = 129 = 0x81.

      In two's complement: -128 + 1 = -127 = 0x81

      The reason two's complement math is used is because the summation circuit for signed and unsigned values is the same. The difference circuit is only slightly different from the summation circuit - it adds a unary negation in front of the addition. But subtraction for signed or unsigned numbers is the still the same circuit.

      --
      Education is a better safeguard of liberty than a standing army.
      Edward Everett (1794 - 1865)
    36. Re:Forget It by Wavicle · · Score: 2

      I'm not sure I get your argument...

      If you are streaming data I/O, then the primitive objects would be sent as their 8/16/32/64 bit primitive representations.

      Primitive objects do not have to take up a lot more memory than primitive types. I could envision an implementation that kept primitives small until you tried to inherit from them, or wait/notify on them (something the author of the article wanted, but I think just having finals would be adequate).

      The actual memory required for an Object doesn't have to be that large. And what the author of the article really seemed to want was the ability to add a primitive to a collection without having to write 8 add() methods for each primitive or wrapping the primitive every single time. Having the compiler transparently do it all would be sweet.

      --
      Education is a better safeguard of liberty than a standing army.
      Edward Everett (1794 - 1865)
    37. Re:Forget It by Anonymous Coward · · Score: 0

      You are a jackass. He was referring to a VB application not a VB Script.

    38. Re:Forget It by jaymz168 · · Score: 0

      Or you could of used those of-so-wonderful PIF files to try to keep memory use and hotkeys in check, the reasons lots of DOS progs crashed in Win3.1......DOS4GW??

    39. Re:Forget It by kinga · · Score: 1

      According to the JVM Spec classfiles already have a version number:

      ClassFile { u4 magic /* 0xcafebabe */; u2 minor_version; u2 major_version; ... }

      The version is major_version.minor_version, and at JDK 1.0.2 it was 45.0.

      Note that the VM executes first and only checks the version number when it actually loads a class.

    40. Re:Forget It by Ryosen · · Score: 1

      You can tell JBuilder (and most other IDE's) what version of Java to use. You simply tell it what JDK compiler to use. In fact, many IDEs (e.g. JBuilder 7) allow you to specify the JDK version on a project-by-project basis.

      --

      Ryosen
      One man's "Troll, +1" is another man's "Insightful, +1".
    41. Re:Forget It by Ryosen · · Score: 1

      I'd just a soon stuff them into a Byte (the object) as a byte (the primitive)

      I'm not sure why you would want to incur the overhead of wrapping a primitive with an object. For the base OutputStream, it is far more efficient to send the single byte value. Even if you use a DataOutputStream for the other primitive types, it is still far more efficient to use primitives. Objects contain a significant amount of overhead for their supporting structures. In order to send an object over a stream, it must be serialized, sent, then deserialized on the recieving end. This requires far more overhead than sending a simple primitive.

      --

      Ryosen
      One man's "Troll, +1" is another man's "Insightful, +1".
    42. Re:Forget It by JebusIsLord · · Score: 1

      way to pick on me for misusing a word. god i hate the internet.

      --
      Jeremy
    43. Re:Forget It by mentin · · Score: 1

      You mean boxing of primitives as implemented in .NET, right? They do exactly this.

      --
      MSDOS: 20+ years without remote hole in the default install
    44. Re:Forget It by AMNESIACX · · Score: 1

      The IO streams can still be of primitive type, its the JVM at each end that might act as the type wrapper.

      --
      "It's not just what you say, no it's mostly how you feel it." - Tim Buckley.
  2. Java 3?? by Jugalator · · Score: 2

    Hmm...

    "Java 1" is traditionally Java 1.1.x.
    "Java 2" is Java 1.2.x.

    "Java 3" is ...?

    Anyway, Java 1.4.x is out now. :-)

    --
    Beware: In C++, your friends can see your privates!
    1. Re:Java 3?? by Jugalator · · Score: 2

      To further add to the confusion: "Java 3" is used here at /. while the article talk about "Java 3.0" even if the current version, Java 1.4, is *way* off being Java 2.0.

      --
      Beware: In C++, your friends can see your privates!
    2. Re:Java 3?? by iapetus · · Score: 4, Insightful

      Java 2 (or 'The Java 2 Platform') is used to refer to all versions of Java since 1.2 - the idea being that the Java platform came of age at that point, having managed to absorb the major new features added in 1.1 and being ready for enterprise use. So JDK 1.2, 1.3 and 1.4 are all still Java 2.

      Given how interesting that sort of numbering approach is already, I see no additional confusion springing from the idea that Sun could declare 'Java 3' starting from JDK 1.6 - anyone who's going to get confused by these things already is. ;)

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    3. Re:Java 3?? by Jugalator · · Score: 1

      Ah, thanks for sorting that out. :)

      But the author still had "Java 3.0" in his article which I found funny. But perhaps he's talking about a Java quite a bit into the future.

      --
      Beware: In C++, your friends can see your privates!
    4. Re:Java 3?? by Anonymous Coward · · Score: 0

      Wow you can type and kind of think at the same time, did you understand anything from the previous post?

  3. Microsoft can do it... by Anonymous Coward · · Score: 1, Insightful

    Microsoft Visual Studio .NET is not compatible with old versions. Visual Basic.NET only has a shallow likeness to it's predecessors.

    Sometimes it is possible and necessary to break compability.

    1. Re:Microsoft can do it... by Anonymous Coward · · Score: 0

      That is patently untrue. Visual Studio.Net still supports C++ and Visual Basic.Net is very similar to VB except that it is now a true OO language (Inheritance, encapsulation, and polymorphism) and it forces you to write better code.

    2. Re:Microsoft can do it... by Shalda · · Score: 1

      No, Microsoft freely admits (and almost brags) that they came to a realization that to fix BASIC, they first had to completely break it. Back to the origional post... "made to incorporate the advances in the last 7 years of its life and without the requirement to keep compatibility with old versions."

      It's called C#. Use it, love it, be a card carrying Microsoft whore.

    3. Re:Microsoft can do it... by devmanager · · Score: 1

      There's some truth here, but you're distorting the hell out of it. To begin, MS did break compatibility with older code *to some extent*. In the case of Visual Basic, for instance, there are some language features that are no longer supported, but many programs will work just fine with no modifications, and others will work after an upgrade script converts some of these old structures to new ones. Next, C# *is* brand new, but C++ still exists. I can't speak to compatibility between C++ in .Net vs. the previous version, but I suspect that, like VB, C++ remains largely intact. Microsoft *is* offering developers a brand new language in C# for many of the reasons that drive the call for a new version of Java. The upgrade path is not insignificant, however, which is part of the reason why MS introduced this brand-new language. Java can grow, but to do so at the expense of backwards compatibility would be suicide.

      --
      ____DevManager_____
    4. Re:Microsoft can do it... by orenmnero · · Score: 1

      You are correct. None of my Visual C++ projects broke under the new .NET version. The only significant factor I have seen in my projects are some additional warnings, but nothing that has stopped compilation. When people say that MS changed C++ they are usually refering to Managed C++. Managed C++ does not replace C++ by any means. It is ideal for creating .NET wrappers for legacy C++ code.

    5. Re:Microsoft can do it... by Shalda · · Score: 1

      Perhaps I should clarify. I am a card carrying Microsoft whore. I also think .NET is the best thing to happen to BASIC since VB was first released. For me, none of my old VB programs are good candidates for porting to VB.NET. Parts of them are, and there are chunks of code that I can copy in unaltered, but more often, I end up rewriting large sections of code. This isn't all bad, in that I end up writing better code and programs. But back to topic, I'll happily give up backwards compatability for a substantially improved product.

    6. Re:Microsoft can do it... by Anonymous+Brave+Guy · · Score: 2
      Next, C# *is* brand new, but C++ still exists. I can't speak to compatibility between C++ in .Net vs. the previous version, but I suspect that, like VB, C++ remains largely intact.

      C++ is not a Microsoft product, and hasn't changed a bit with the release of Visual Studio.NET. Microsoft's implementation of same, which they now called "unmanaged C++", also hasn't much changed (but can't use most of the useful bits of .NET, either). Microsoft's .NET-friendly version, "managed C++", is just another syntax for the C#/VB.NET combined entity, with all the same limitations (no generics, MI, etc).

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  4. 10 Reasons We Need Java 3 by af_robot · · Score: 5, Funny

    1. speed
    2. speed
    3. speed
    4. speed
    5. speed
    6. speed
    7. speed
    8. speed
    9. speed
    10. profit

    1. Re:10 Reasons We Need Java 3 by eddeye · · Score: 1

      Damn, where are my moderator points when I need them?!

      --
      Democracy is two wolves and a sheep voting on lunch.
    2. Re:10 Reasons We Need Java 3 by Citizen+of+Earth · · Score: 2
      Don't you mean:
      1. speed
      2. speed
      3. speed
      4. speed
      5. speed
      6. speed
      7. speed
      8. speed
      9. ???
      10. PROFIT!
  5. One big thing Java needs by Trinition · · Score: 5, Insightful

    One big thing Java needs is a multi-process VM. Think about it, how many processes does your machine run? Probably lots. How many does a Java virtual machine run? One. Each process has its own VM. While this might have some advantages when it comes to controlling crashes and security, it also means each process has the initial overhead of starting the VM and the continuing overhead of the same duplicated code running in memory for each VM.

    Startup time is not only an actual problem, but its gives a very bad impression when just launching a program takes a while. jEdit, a popular Java text editor had to overcome this by attaching to an existing server process. Kludges like this shouldn't be necessary.

    1. Re:One big thing Java needs by Anonymous Coward · · Score: 0

      Definitely. This is what stands in the way of having a Java VM running all the time, which in turn makes the long initialization painful.

    2. Re:One big thing Java needs by Westley · · Score: 2, Informative
      This is already coming in Java 1.5 (with any luck) in the form of the isolation API. See JSR 121.

      Jon

    3. Re:One big thing Java needs by THEbwana · · Score: 1

      ... Or you could do this:
      http://www.sys-con.com/java/articlea.cfm?id =1408 /m

    4. Re:One big thing Java needs by funkman · · Score: 1
      Multi-process VM's will confuse the issue. The JVM is a virtual machine. As a developer - I should care only about being able to execute multiple "things" concurrently or in parallel. Whether this is via threads (OS or non-OS) or multi-process JVM's I as a developer should not care about. Once I care too much about this - I get locked into a harware/software scheme which may be harder to expand in the future. (Its the typical flexibility vs speed tradeoff)

      I believe what we really need is for OS to allow for threads to segfault without taking the whole process down. If a thread crashes - a new signal is sent to the process to let the application know.

      Once you allow threads to crash - you can actually have one giant JVM running that can dynamically classload/discard applications as needed. Start the JVM base service at boot time and start time for applications should be "quick".

    5. Re:One big thing Java needs by Anonymous Coward · · Score: 1, Informative

      What you want is called Echidna and works for all JVMs:

      http://www.javagroup.org/echidna/

    6. Re:One big thing Java needs by Anonymous Coward · · Score: 0
      This is well on its way. There is a plan for a feature called "isolates" (this is a noun) which implements this. Here is the JCP:

      http://www.jcp.org/jsr/detail/121.jsp

      Initial support is planned for 1.5, full support for 1.6.

    7. Re:One big thing Java needs by Anonymous Coward · · Score: 0

      http://www.javagroup.org/echidna/

      not like it does not exist

    8. Re:One big thing Java needs by let_freedom_ring · · Score: 1

      "One big thing Java needs is a multi-process VM. Think about it, ... Each process has its own VM. ... continuing overhead of the same duplicated code running in memory for each VM."

      Isn't this already in Solaris???
      In Solaris when you start a program multiple times it SHARES the same executable that is already present in memory between all of the processes. The only thing that gets duplicated per process is the data and you want the data memory to be unique between JVM's.

    9. Re:One big thing Java needs by sbrown123 · · Score: 1

      >>How many does a Java virtual machine run? One.

      When I run Java on my Linux box it shows it running on 10+ processes (ps -Af | grep java).

      >>Each process has its own VM. While this might have some advantages when it comes to controlling crashes and security, it also means each process has the initial overhead of starting the VM and the continuing overhead of the same duplicated code running in memory for each VM.

      How about a single JVM (not process) that launches multiple Java programs? Thats not too hard to create.

      >>jEdit, a popular Java text editor had to overcome this by attaching to an existing server process. Kludges like this shouldn't be necessary.

      JEdit on Windows has a native launching program. Everything, including the plugins, run in this same JVM instance. JEdit can launch other Java programs from this instance using the Console. I have never heard of any kludges in Jedit.

    10. Re:One big thing Java needs by jilles · · Score: 4, Informative

      In a JVM the data is all loaded classes, their on the fly compilations and many other resources that can and should be shared by java applications. Much of the overhead of starting a java application actually comes from loading and compiling classes. If you can share JVMs the classes have to be loaded only once.

      Due to the fact that the java classloader happens to be one of its cool features it is actually dead easy to implement this feature safely. Many java application launchers exist already that can let you share a jvm with multiple applications. I used several of them and was amazed at the difference in performance.

      --

      Jilles
    11. Re:One big thing Java needs by Anonymous Coward · · Score: 0
      One big thing Java needs is a multi-process VM

      Take your pick:

    12. Re:One big thing Java needs by Anonymous Coward · · Score: 0

      > When I run Java on my Linux box it shows it running on 10+ processes (ps -Af | grep java).

      On other operating systems those are implemented as threads belonging to one process. It's just a Linux quirk that everything has to be visible processes.

      > How about a single JVM (not process) that launches multiple Java programs? Thats not too hard to create.

      That's what they want. It is a little hard to create though. For one, they want to do it transparently so your code doesn't do any work to be moved into a running JVM. The other is reliability and protection so one process can't break the other processes in the JVM.

      > JEdit on Windows has a native launching program. Everything, including the plugins, run in this same JVM instance. JEdit can launch other Java programs from this instance using the Console. I have never heard of any kludges in Jedit.

      That's neither transparent nor reliable. They had to write code to do the VM sharing and there's no way for some outside program to get into the VM. It has to be launched by JEdit from the inside. Also, if one program calls exit (), either the whole thing shuts down or exit gets ignored, depending on the security settings. Things like that should work just as if the process had its own VM (ie, exit succeeds but just that process exits).

    13. Re:One big thing Java needs by Trinition · · Score: 2

      I did look into Echidna some time ago. It looks as though development has stopped on it. A couple of things could be done to improve it because it still ain't easy.

      A multi-process JVM should basicallya llow you to run as many Java applications as you want in a single VM, and the ability to kill any particular one. They should be as easy to start as executing a normal Java program (mostly execcutable jars).

      One thing I know Echidna lacks that should be in a multi-process JVM is the concept of partitioning some things on a process boundary. System properties are for the system, but a process should be able to have properties as well, to possibly override some system properties, or have some private properties for the process to use without other processes seeing/manipulating them.

    14. Re:One big thing Java needs by Anonymous Coward · · Score: 0

      Looks like one has to be a subscriber to see anything after the first page. Sounds like they implemented their own Echidna-like solution, though?

    15. Re:One big thing Java needs by diablovision · · Score: 1

      G. Czajkowski, L. Daynes, "Multi-tasking without compromise: a Virtual Machine Approach", Proceedings of Object-Oriented Programming, Systems, Languages and Applications, October 2001, Tampa, FL.

      G. Czajkowski, L. Daynes, M. Wolczko, "Automated and Portable Native Code Isolation", Proceedings of the 12th IEEE International Symposium on Software Reliability Engineering, Hong-Kong, November 2001.

      --
      120 characters isn't enough to explain it.
    16. Re:One big thing Java needs by tullmann · · Score: 2, Informative

      Multi-process JVMs are coming. Its called "Application Isolatation".

      JSR-121: http://www.jcp.org/jsr/detail/121.jsp

      The Expert Group is hoping to release its draft API to community review in a month or so. The draft API on the above web page is 1 year out of date, but is useful to get a handle on the scope of what's being done (if not how the API will accomplish it).

      If you can't wait, check out the JanosVM:

      http://www.cs.utah.edu/flux/janos/janosvm.html

  6. Serious features seriously needed by Anonymous Coward · · Score: 2, Insightful

    I have spent the majority of my time over the past 4 years programming Java professionally for a number of large corporate clients, mostly in the banking and telecoms sectors. While Java has certainly allowed me to increase my productivity substantially over more 'traditional' languages like C and C++, there are still a number of important features that should be included in Java 3 in order for it to fully cement it's supremacy over C/C++:

    - Multiple inheritance: some problem domains just don't map cleanly onto a single-inheritance model, and need the power that only multiple inheritance can bring. Multiple inheritance often leads to clearer code representations in the developer's head, avoiding the abstract mess present in languages like C++ and Eiffel which only kludge this feature with 'interfaces'.

    - Operator overloading: this can be a natural and productive extension for the experienced coder, and aid the junior programmer to get up to speed quickly. Again, an important omission in other languages which should be fixed

    - Pointers and direct memory access: Java currently makes it very difficult to write specific machine-targeted instructions. I find it frustrating that I can't wring out every last bit of performance from whatever CPU I'm coding for. The designers of Java really blew that one. Direct memory access with pointers like in Visual Basic and Delphi would be a godsend.

    1. Re:Serious features seriously needed by Toraz+Chryx · · Score: 3, Insightful

      I find it frustrating that I can't wring out every last bit of performance from whatever CPU I'm coding for.
      Um, isn't one of the key selling points of Java portability?, allowing programmers to write code for a specific (family of) cpus would utterly break that..

    2. Re:Serious features seriously needed by Bush_man10 · · Score: 2, Interesting

      But the beauty of java is that we don't have to directly access/manage memory. I for one would be scared to see what would happen if you gave a java programmer access to pointers when they never programmed in c/c++ before. Java does have pointers though because everythign is passed by referennce but it's all done for you. Pretty sweet actually...

      Operator overloading is an excellent way to code in c++ but I have no problems in saying Array.copy(array1, array2) myself.

      If you ask me the major problem with java is the speed issue. It will never be as fast as c/c++. But thats life...

      --
      "I believe in everything in moderation. Including moderation." -Dean DeLeo, Stone Temple Pilots
    3. Re:Serious features seriously needed by twem2 · · Score: 2, Insightful

      All these 'features' you suggest are reasons Java is better than C/C++ in my opinion.
      Perhaps multiple inheritance could be done in a sane way, but there's interfaces to avoid the need for multiple inheritence.
      Operator Overloading - This is asking for trouble. I wouldn't mind having different arithmetic operators for Ints and Reals, it would make my life easier in the long run.
      Pointers and direct memory access - ummmm, this is part of the point of Java, portable code, no direct memory access.

      I would like to see a clean up of the APIs, and threading is a bit of a mess. And making basic types proper classes would be great.

    4. Re:Serious features seriously needed by Kindaian · · Score: 1

      For that you need to start programming in assembler... preferibly at micro-code level!

      THAT IS PERFORMANCE!

      (but IMHO that is not why there is Java...)

      Cheers...

    5. Re:Serious features seriously needed by Y+Ddraig+Goch · · Score: 2, Insightful

      JAVA is not C++ nor was it ever intended to be. Does it need cleaned up? Yes. Does it need new/more features? Yes. But, then again what language doesn't. JAVA does what it does quite well, allows code to run many different platforms. All the user needs is a Java Run Time module and the code will work.

      --
      Meddle thou not in the affairs of Dragons, for thou art crunchy and with most anything.
    6. Re:Serious features seriously needed by Richard_Davies · · Score: 2, Insightful

      Java + Multiple Inhereitence + Operator Overloading + Direct Memory Access.

      Sounds like you have C++ envy. Maybe you should change languages if you really need all that. Java works quite well for most things without any of these features.

    7. Re:Serious features seriously needed by Jugalator · · Score: 3, Interesting

      I always wondered why Sun didn't make compilers for the most common OS'es. So we'd have something like this:

      Java Source -> Bytecode -> Windows .. or ..
      Java Source -> Bytecode -> Solaris .. etc.

      Not only the source would be portable, but also the bytecode, as always. No changes, just a damn bytecode compiler. Of course, the java interpreter should still be included if you for some reason didn't want to run optimized code for your CPU or had a CPU that wasn't supported with specialized native code compilers.

      The only thing that would mess things up would of course be if someone just distributed the native compiled code, but wouldn't that be just a brainless thing to do since if you included the bytecode everyone would be able to use it?

      ???

      --
      Beware: In C++, your friends can see your privates!
    8. Re:Serious features seriously needed by NorthDude · · Score: 1

      Can you explain me why multiple interface implementation doesn't do the trick for you?

      And while I understand your point about the lack of pointer,
      I really think it would go out of there mission if they would allow you that.
      Whenever I need to do special platform-dependant code
      for which I need this kind of control, I symply wirte it in C and wrap it with JNI.
      It may not be the most "elegant" way of doing things, but it works A1.
      And I prefere it to a solution which would allow you
      to use native code inside special "flags" as it force me to cleanly separate functionalities.
      If one day I don't need this platform specific piece of code, I just have to replace the class used by a new implementation.

      Operator overloading whould be a nice thing, but I can live without this for now...

      --


      I'd rather be sailing...
    9. Re:Serious features seriously needed by Anonymous Coward · · Score: 1, Interesting

      If you ask me the major problem with java is the speed issue. It will never be as fast as c/c++. But thats life...

      Not true! Sun has recently published some benchmarks which clearly show Java pulling away from C++ in a number of key B2B, B2C and ERP related benchmarks, including the ugly object-creation heavy SKAN-K test, the datamining 4-EYES benchmark, and the industry standard scientific calculation HOmark suite.

      It's a good day to be a Java programmer!!

    10. Re:Serious features seriously needed by tahirbond · · Score: 1

      I think theres' a lot more thought that should go in the design of VMs. Now that the code doesn't have any architecture specific smarts, it's up to the VM writers to find the best ways to utilize a specific architecture's strong points and work around weaker ones.

      A case in point is the performance of Sun JVM in Linux. We once had a bare-bones servlet runner that did DB connection pooling through threads. The code ran ~ 10x faster on Windows than on Linux. Later analysis showed that the Linux VM was spawning a new process for every thread!

      Some one recommended using IBM's JVM but we never came to that.

    11. Re:Serious features seriously needed by Bush_man10 · · Score: 1

      I guess you never used java to program on a pic before? Or attempt to do some hardware control. You can't have a robot where there is 1 second lag in it's choices. I never ever had a problem with c/c++ on a pic.

      From that experience alone I always thougth of java as a slower language. Java has it's place and it's not on a microcontroller :)

      --
      "I believe in everything in moderation. Including moderation." -Dean DeLeo, Stone Temple Pilots
    12. Re:Serious features seriously needed by mark_lybarger · · Score: 4, Interesting

      java allowed you to increase productivity, substantially?

      according to this whitepaper, when developers are given their preferance of language to use to implement a solution, they're most productive. ie, someone who knows c++ and enjoys working in c++ will be just as productive as someone who knows java and enjoys working in java.

      i'd be extremely interested to see some concrete independant studies showing otherwise.

    13. Re:Serious features seriously needed by mccalli · · Score: 2
      Perhaps multiple inheritance could be done in a sane way, but there's interfaces to avoid the need for multiple inheritence.

      Well...I find interfaces to be done fairly badly, to be honest. I would like to be able to provide a default implementation for interface methods.

      Of course, once you've done that you're half-way to multiple inheritence anyway. But half-way, not the full way.

      Cheers,
      Ian

    14. Re:Serious features seriously needed by NorthDude · · Score: 1

      This is the purpose of JIT compiler...
      This way, you CAN'T redistribute the compiled version.
      I must admit there is still a lot of work to do in this area, but once this will be addressed,
      Performance could really increase by much...

      --


      I'd rather be sailing...
    15. Re:Serious features seriously needed by RevAaron · · Score: 2

      There already exist Java->Native code compilers. Like GCJ. It's GNU, baby. However, compiling to native code has its drawbacks as well, like breaking compatibility with certain dynamic "features" of the language.

      If you want a "faster," not cross platform language use C or Objective-C. Java isn't what you want.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    16. Re:Serious features seriously needed by RevAaron · · Score: 2

      Like anyone says about any benchmark, they are rubbish. There are people out there who do a lot of straight-up numerical computing with Java. But for the majority of us who just use Java apps, real-world application performance is abysmal. That is the real benchmark. You can spout numbers all week, but it's still manages to be slow by the time it reaches the user.

      It's a good day to be a Java programmer, but a bad time to be a LimeWire user!!

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    17. Re:Serious features seriously needed by obsidian+head · · Score: 1

      You're arguing featuritis. These features will never be implemented because they don't present a "simple" interface to the language.

      If you read the original design doc (sorry, don't have the link on me), you'll see it was a language designed for the average programmer. You will not find MI or operator overloading.

      Pointers is another issue altogether. You might be a troll from this comment, I'm not sure. Anyway you can drop into it from JNI.

    18. Re:Serious features seriously needed by Jugalator · · Score: 2

      I must admit there is still a lot of work to do in this area, but once this will be addressed,
      Performance could really increase by much...


      Yeah, it use to sound like this (one day - one day!). I'm sure the JIT does an amazing job at optimizing in real-time, but I don't think it's as good as true, "precompiled", native code.

      --
      Beware: In C++, your friends can see your privates!
    19. Re:Serious features seriously needed by RevAaron · · Score: 2

      That's because Java retains a huge amount of idea-cruft that exists in C++. You still do things very much the same way- compile-run-debug. Wait, wait, wait. Get more coffee. Is it done compiling? Almost!

      Contrast this to languages like Smalltalk or Common Lisp- you don't have to recompile in the same way. You don't exit and start applications when you change a couple methods. Changes take effect then and there. With systems like these, you could easily increase your productivity.

      Java on the other hand, is C++ with garbage collection. A big deal to some C/C++ers who have been living in a hole for the last 30 years, but nothing that will double your producivity.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    20. Re:Serious features seriously needed by Anonymous Coward · · Score: 0
      Direct memory access with pointers like in Visual Basic and Delphi would be a godsend.
      Umm.... nice try.
    21. Re:Serious features seriously needed by plumby · · Score: 5, Insightful
      Multiple inheritance

      Multiple inheritance has major problems (if both superclasses have the same function, which one do you use?). A much better answer is often to use "Composition", where the class you are writing contains both of the superclasses that you want to extend, and have your class manually delegate to which ever one of the classes you want to perform the operation. See the "Inheritance versus Composition" section of "Design Pattern" for more details.

      Operator overloading

      I agree that it is a shame that this was not included. The usual arguement against them, that it's very easy to change the semantic meaning of an operator and this can confuse developers, is just as applicable to an "add" method, but I don't think it's a devastating loss to the language.

      Pointers and direct memory access:

      Ye gods. No. The moment you start doing this is the moment Java stops being cross platform, and this is a far more important feature than the extra performance that you could squeeze out of it with direct access. Since they sorted most of the performance issues out, I've rarely seen an app where there was any noticable issue in the speed of the actual java code at all (speed of DB link/RMI from overuse of EJBs are much more likely to be problems and unlikely to be sorted out with direct memory access. If you really need to do it, then write that bit in C or assembler on your native platform and call it using JNI. It's messy, but it makes sure that you really think about whether you need it or not.

      You seem to have missed the biggest C++ related ommission from Java - templates. The ability to create typed arrays using a single line is something that Java would really benefit from.

    22. Re:Serious features seriously needed by Jugalator · · Score: 2

      If you want a "faster," not cross platform language use C or Objective-C. Java isn't what you want.

      I want a cross-platform language and Java isn't what I want? The problem is that I want it to be fast too. C++ (which I also program) isn't exactly portable. Java isn't exactly fast.

      But GCJ was exactly what I was talking about. :) Interesting.

      --
      Beware: In C++, your friends can see your privates!
    23. Re:Serious features seriously needed by sunking2 · · Score: 2
      pseudo c++

      class plane {
      move()
      }

      class boat {
      move()
      }

      class flyingboat inherits plane, boat {
      if(flying)
      plane::move();
      else
      boat::move();
      }

      Nice and simple. interfaces and abstract classes to do the same is not nearly so quick
    24. Re:Serious features seriously needed by NorthDude · · Score: 1

      I agree 100% with you, and that's my point.
      For now, from what I know, hotspot for exemple
      will only "optimize" pieces of code which it finds can and must be optimized.
      While at run-time it is faster to optimize only slow part of the application
      (compiling everything adds overhead which could make thing slower than they are) they could adopt a way of compiling the application once at installation time or the first time it is ran.
      Once it is compiled, use this version and recompile only if a new deployment have been made.
      And with the dynamic loading nature of Java, adding new classes or modules to an aready compiled application would not necessarily need and entire recompilation.

      But anyway, I'm not into compiler design...

      --


      I'd rather be sailing...
    25. Re:Serious features seriously needed by Anonymous Coward · · Score: 0

      YHBT. YHL. HAND.

    26. Re:Serious features seriously needed by Hast · · Score: 1

      Yeah but your "silly version example" is not code you'd see in reality.

    27. Re:Serious features seriously needed by Anonymous Coward · · Score: 0

      Ah, but if you provided a default implementation it would no longer be an interface but an implementation of that interface. The idea of an interface is that it specifies a contract that you have to conform to in order to work with some other class or system of classes. It is specified as an interface because the author of the class that you are trying to work with has no idea about how your class migh be implemented. Java does however provide many default implementations of common interfaces so that you can build your classes by extending or agregating them.

    28. Re:Serious features seriously needed by NorthDude · · Score: 1

      pseudo-java


      class plane implements moveable{
      move(){};
      }

      class boat implements moveable{
      move(){};
      }

      class flyingboat implements moveable{

      Plane plane = new Plane();
      Boat boat = new Boat();

      move(){
      if(flying)
      plane.move();
      else
      boat.move();
      }
      }

      You need only 2 more lines of coding.
      That's not bad if it helps eliminate other problems...

      --


      I'd rather be sailing...
    29. Re:Serious features seriously needed by RevAaron · · Score: 2

      Java is "slow" because it's cross-platform. That, and it's poorly designed. It's possible to have a fast Java-like langauge (they exist, but they're not Java!), but Java itself won't be until maybe this fabled java 3 comes out.

      I hope GCJ is everything you hoped it to be. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    30. Re:Serious features seriously needed by thomas.galvin · · Score: 1

      But GCJ was exactly what I was talking about. :) Interesting.

      Unfortunatly, last I heard, it couldn't complie SWING. They were working on it, though.

    31. Re:Serious features seriously needed by ranulf · · Score: 2
      You seem to have missed the biggest C++ related ommission from Java - templates. The ability to create typed arrays using a single line is something that Java would really benefit from.

      I like templates, but in this specific instance, part of the idea is that Java storage containers (arrays, lists, etc.) can hold any object. You want just arrays of X? Well, just unconditionally cast to X when you retrieve the elment.

      Although the excessive casts in Java do annoy me a bit. Do we really ugly code like this:

      Vector v = new Vector();
      Integer x = new Integer(42);
      Integer y = (Integer) v.elementAt(0);

      there's far too much redundancy in all these declarations. The compiler should accept implied casting from Object to any type of object if the L-type of an assignment is already known. Admittedly, you'd still need a cast for things like:

      int x=((Integer)v.nextElement()).parseInt();

      But templates are extremely flexible, for instance allowing you to have an array indexed by some arbitrary object, etc. Also, templates mean that you end up without the need to check object type at run-time and reduce the requirement to have an anonymous Object type.
    32. Re:Serious features seriously needed by toriver · · Score: 2

      That particular example is easily addressed using delegation to instances of the "superclasses". You can even expose the delegates if you wish, for the sake of typing, e.g.

      class flyingboat {

      private boat boatPart = new boat() { // Possible overriding of "boat" behavior here, with full access to flyingboat features
      };

      public boat asBoat() {
      return boatPart;
      }

      }

      Just because you can't do it in EXACTLY the same way as language X doesn't mean Java needs to adapt the particular semantics of language X.

    33. Re:Serious features seriously needed by toriver · · Score: 2
      Java on the other hand, is C++ with garbage collection.

      I thought it was "Managed C++" in .Net which was that... :-)

    34. Re:Serious features seriously needed by thomas.galvin · · Score: 2, Interesting

      Multiple inheritance has major problems (if both superclasses have the same function, which one do you use?). A much better answer is often to use "Composition", where the class you are writing contains both of the superclasses that you want to extend, and have your class manually delegate to which ever one of the classes you want to perform the operation. See the "Inheritance versus Composition" section of "Design Pattern" for more details.

      Composition is, IMO, a cludge. One of the promises of OO is code reuse; I shouldn't have to do inordinant ammounts of work to get at functionality I have already written. As for the diamond problem you mentioned, the solution is simple; if more than one parent class implements a function, force the child class to implement it's one, even if all it does is call ParentName.func();

    35. Re:Serious features seriously needed by toriver · · Score: 3, Interesting
      You seem to have missed the biggest C++ related ommission from Java - templates.

      Coming in J2SE 1.5, by all accounts. A "preview" compiler implementation is available from developer.java.sun.com.

    36. Re:Serious features seriously needed by lgraba · · Score: 2

      Java on the other hand, is C++ with garbage collection. A big deal to some C/C++ers who have been living in a hole for the last 30 years, but nothing that will double your producivity.

      I wholeheartedly disagree with this statement, because you are making a gross simplification. I am much more productive with Java than with C/C++ (I know both well), and for many more reasons that just garbage collection. These reasons are:

      - a comprehensive, well-thought out library. For instance, doing sockets programming in Java is MUCH more straightforward than in C or C++. The same functionality can be had in C++ with some outside libraries, but this is not a standard library. This is true with many more aspects.
      - built in threads support that is much easier to use than POSIX threads.
      - excellent support for distributed programming with RMI and CORBA, and both are standard.
      - Better exception handling
      - Easier building. I don't know how many hours I have wasted trying to compile and link libraries (such as ACE/TAO) completely under C/C++. I especially like when I get unresolved link errors, but no clue on where I might find these functions. With Java, if I have a missing class, the fully qualified name (i.e. package name) usually indicated where the class should be found.
      - Excellent documentation of the libraries. I am much more confortable using the JavaDoc-generated Java documentation than doing man ???? on function calls in C++. If I am using a library feature of Java that I have not used before, the J2SE documentation is usually sufficient for me to figure out what classes to use, the the usage patterns for the classes usually intuitive.

      Adding a garbage collector to C++ would not even cover 10% of the improvement Java provides over C++, from a productivity standpoint.

    37. Re:Serious features seriously needed by toriver · · Score: 1
      Composition is, IMO, a cludge.

      It represents "has-a" relationships; inheritance represents "is-a" relationships. Two different roles.

      I shouldn't have to do inordinant ammounts of work to get at functionality I have already written.

      You're afraid of typing? Why not demand that horribly long class names like ArrayIndexOutOfBoundsException should be shortened to eight chars max while you're at it?

      As for the diamond problem you mentioned, the solution is simple; if more than one parent class implements a function, force the child class to implement it's one, even if all it does is call ParentName.func();

      Because that's not excessive work, you mean? Some languages (Perl, Python) have rules about which classes take precedence, others need you to be specific, and that specificity (which you advocate) becomes a workaround for the problem where the different "roles" you assign to a class have colliding behaviors.

      Personally I consider MI of implementation to be a cludge around bad design where - as you say - the programmer wants to save typing.

    38. Re:Serious features seriously needed by RevAaron · · Score: 2

      Don't tell me, tell the guy who said you weren't more productive. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    39. Re:Serious features seriously needed by a_n_d_e_r_s · · Score: 2

      Well, it's shows that you do not know what you are talking about.

      Threads and processes uses the same internal kernel structure in the Linux Kernel so for an outsider it may look like a new process but in reality the threads all share the same memory adress space. That way one don't need new programs to look at threads but can use the normal tools to examine processes to look at the threads. Genious is it not.

      So maybe you should have analysed it a more thourough than giving up once you came to an uninformed and false conclusion.

      BTW You should have looked at the IBM JVM as it probably would have been faster.

      Also if the time differences are as huge as you claim it should've been easy to find out what really caused them.

      --
      Just saying it like it are.
    40. Re:Serious features seriously needed by renoX · · Score: 3, Insightful

      > Multiple inheritance has major problems (if both superclasses have the same function, which one do you use?).

      Well, in well-defined language (Eiffel), this isn't a major problem: the developer have to solve by hand the conflict and that's all.

      > >Pointers and direct memory access:
      > Ye gods. No. The moment you start doing this is the moment Java stops being cross platform.

      Pointers and direct memory access are two different thing.
      Pointers in themselves can be used without preventing cross platform portability.
      As for direct memory access, it's true that it is against portability, so what?
      JNI are also non-portable but it doesn't mean that we should totally get rid of JNI.

      As for the end, I agree: the lack of template in Java is quite annoying.

    41. Re:Serious features seriously needed by arkanes · · Score: 2

      You know, I can't honestly see how there's any real problem with MI - at least not from a technical standpoint. I can think of at least a couple ways to specify which base class method to use right off the top of my head, including having it specified by the order you declare the inherits, or requiring it to be explicitly declared if there's a conflict (in fact, no reason you can't use both these methods, based on your compiler settings). MI is a handy way of addressing some problems, and inheritence, in my experience, is nothing more than a formal declaration of reimplementation.

    42. Re:Serious features seriously needed by Fringe · · Score: 1
      Java is "slow" because it's cross-platform.
      I disagree. Good C++ source is cross-platform and plenty fast once compiled. Most of the cross-platform bits that care about the platform resolve to rather quick API calls. There are two sources of slowness: the compiling and the binding.

      The compile time problem could be fixed, but Java's problem, similar to Smalltalk's, is that the code can't -really- be compiled to the machine-code level that C++ can be due to the extremely late binding. As compiler technology has advanced, this has become a more solvable problem, but it's a big implementation project (read "expensive.") The real problem is lack of financial incentive for Sun to solve the problems.

    43. Re:Serious features seriously needed by Anonymous Coward · · Score: 0

      From the flip side of this argument (a C++ programer with Java envy). I'd like to see the Java libraries reimplemented for C++ programers. Get rid of multiple inheiritence in standard libraries and replace it with the concept of the interface and I'm happy. Having a standard GUI, network, thread, database, xml, and all the other classes.

      #import // fun huh?

    44. Re:Serious features seriously needed by Jugalator · · Score: 2

      Ok, I think I understand the problem better now - thanks. It was also sort of the answer I expected... Sun might not have the resources to develop and support several different low-level compilers. :-/

      --
      Beware: In C++, your friends can see your privates!
    45. Re:Serious features seriously needed by MarkoNo5 · · Score: 1
      > Multiple inheritance has major problems

      You clearly didn't read the OO bible yet (Object Oriented Software Construction by Bertrand Meyer). There is NOTHING wrong with multiple inheritance, the only problem is that there is just one language that does it right : Eiffel. Without it, you always find yourself emulating it in some way. I'm doing it at this very moment because there simply isn't an alternative.

    46. Re:Serious features seriously needed by SnapShot · · Score: 1

      How about a Java feature that allowed you to assign a default class type to another object at compile time.


      Vector c = new (MyDataObject)Vector();


      It would clarify a lot of code in that you would know what the programmer intended to store in that collection.

      Another possibility.


      class Vector extends Array implements Collection uses TemplatedObject {

      void put(TemplatedObject index) { ... }
      TemplatedObject get(int index) { ... }

      }

      where the "uses" keyword acts similarly to the C++ template

      --
      Waltz, nymph, for quick jigs vex Bud.
    47. Re:Serious features seriously needed by thomas.galvin · · Score: 1

      Composition is, IMO, a cludge.
      It represents "has-a" relationships; inheritance represents "is-a" relationships. Two different roles.


      Yes, they are. And thus, composition is insufficient when multiple inheritance is called for.

      If a class really "is-a" child of two other classes, it should inherit from both of those classes. It should not contain those classes and provide accessor methods to the functionality of those classes. I'm not afraid of typing, but I am opposed to it when there is no good reason for it.

      As for the diamond problem you mentioned, the solution is simple; if more than one parent class implements a function, force the child class to implement it's one, even if all it does is call ParentName.func();
      Because that's not excessive work, you mean?


      Exactly, it is not excessive work. I code for a living. I would rather not have to spend time on trivial matters. Pick a solution and implement it. If I were solving this problem, that is the solution I would use.

      Personally I consider MI of implementation to be a cludge around bad design where - as you say - the programmer wants to save typing.

      If the class you are writing needs the functionality of two other classes, there is no good reason to type more than extends foo, bar. If there is an implementation conflict, then have the developer sort it out. Otherwise, get out of their way. Remember, typing is working, and the less time you spend working on old problems, the more time you spend on the important stuff.

    48. Re:Serious features seriously needed by Hard_Code · · Score: 2

      "I always wondered why Sun didn't make compilers for the most common OS'es."

      Maybe because they already burn lots of money giving Java away for free to ungrateful people who then go and build an industry on it. Sheesh. Write your own native compiler for <your favorite CPU>. Or use GCJ. Or use .NET.

      --

      It's 10 PM. Do you know if you're un-American?
    49. Re:Serious features seriously needed by pmz · · Score: 2

      ...someone who knows c++ and enjoys working in c++ will be just as productive as someone who knows java and enjoys working in java.

      This is very largely true, given the learning curve for any complex system.

      Another issue when choosing a language is the requirements for the software. Each language may lend itself well to a different problem, with dramatic results. Both Java and C++ are extremely versatile, but it would be a stretch to say they are "one size fits all."

    50. Re:Serious features seriously needed by Anonymous Coward · · Score: 0

      > You seem to have missed the biggest C++ related ommission from Java - templates. The ability to create typed arrays using a single line is something that Java would really benefit from.

      Already using it. Standalone alpha compiler has been released. Target for bundling with the standard distribution: 1.5 or 1.6.

    51. Re:Serious features seriously needed by puppetluva · · Score: 2

      Guys,

      Java 1.4 has a feature called Generics and it solves the same problem you want to use templates for. It solves the casting issue and is very powerful. Please read the spec (or spec summaries) to learn about generics.

      A brief, brief description of generics is: You can programmatically force a collection or set to only deal with one type of object. That collection thereafter will not accept objects that are not of that type and you don't have to explicitly cast the objects you pull out of it.

      Generics save a lot of time. Java didn't invent them, but sure has them now, so we should gripe about something else.

    52. Re:Serious features seriously needed by Anonymous Coward · · Score: 0

      What a troll!! That is awesome, I commend you. You really got people with that one, since you just want to turn Java into C++.

      +1 Insightful indeed.

    53. Re:Serious features seriously needed by Anonymous Coward · · Score: 0

      benchmarks are easy to fiddle.. Java beats C++ when it comes to allocating memory - ie. Java GC has already 'preallocated' memory, whereas C++ will walk the heap looking for gaps.
      So.. java uses lots more Ram than a C++ heap.. so what... ram is cheap after all.. until you come to garbage collect.

      there are more examples of architectural 'fiddles' for benchmarks. don't believe the hype.

    54. Re:Serious features seriously needed by pHDNgell · · Score: 1

      Keep in mind that an interface is just an abstract class with the additional requirement that there can be no non-abstract methods in the interface. This is the point at which it becomes unreasonable. It leads to lots of implementations of the exact same functionality (imagine how many implementations of getString() in JDBC ResultSet classes do the exact same thing).

      So, there are two needs for Interfaces. Java deals with one of them, while leaving code reusability kind of out to dry.

      Operator overloading is certainly not a bad thing. Evidence of this is in the String + operator in java.

      --
      -- The world is watching America, and America is watching TV.
    55. Re:Serious features seriously needed by Prior+Restraint · · Score: 2

      I would like to be able to provide a default implementation for interface methods.

      What you want is an abstract class.

    56. Re:Serious features seriously needed by axlrosen · · Score: 2

      Several other companies have done this. It seems to make some things faster and some things slower. Overall, the cost doesn't seem worth the moderate speedup in some apps. See this report.

    57. Re:Serious features seriously needed by RevAaron · · Score: 2

      That's exactly my point. There's nothing inherent to cross-platform languages that would make it slow- perhaps it's not a good example, but Smalltalk applications usually perform better from an end user perspective. They don't "feel" sluggish. They do poorer than Java in numerical benchmarks, but as we all know, benchmarks are rubbish.

      However, due to the very costly effort to get a native-code cross platform language that performs as well as C++ which was written without regard to portability is possible. Very portable C++ code tends to be slower than if it were written against some "native" API, because there are additional layers to produce compatibility.

      It wouldn't be so much of an issue if the platforms in question were just different hardware (CPU) platforms running the same OS. OpenStep is a great example of this. very strictly controlled API between different versions of the OS targeted for CPUs- SPARC, x86 and 68k. Just a series of checkboxes for what CPUs you wish to compile.

      It could be true with Linux as well, however running Linux/PowerPC I've encountered quite a few problems recompiling just C or C++ applications that are supposed to be portable. Poorly written, yes, not intrinsic to C/C++. With a system like OpenStep though there is a lot more thought and control of the API between platforms.

      There are versions of SMalltalk which compile to the native hardware, but like Java you stand to loose certain dynamic features of the language. There are ways around these problems though. And quite a few Common Lisp implementations- just as dynamic as Smalltalk- do get around them.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    58. Re:Serious features seriously needed by Jhan · · Score: 1

      >>It will never be as fast as c/c++. But thats life...
      >Not true! [Study showing Java is faster than C++]

      Great! Couple this with the various studies I've seen over the years that prove beyond doubt that

      • C++ matches the speed of pure C.
      • Modern C compilers trounce assembly.
      and it's now obvious to anyone that Java beats hand optimized assembly code, in speed and memory foot print, perhaps by so much as (adding) 50%! I'm so glad!

      Of course, this large Java application that I work in daily (and authored) takes 20 seconds to load, and about 4 seconds for a database query, whereas the pure C version it replaces takes .5 seconds to load and .1 seconds for a query. But I'm sure I (and all the users I have to eat humble pie in front of since I made the new app) are just hallucinating. Happy, happy, joy, joy!

      --

      I choose to remain celibate, like my father and his father before him.

    59. Re:Serious features seriously needed by alext · · Score: 2

      Really? I use Borland JBuilder and WebLogic Workshop - both 100% Java GUI apps, and performance is fine. Actually, JBuilder 4 performance was fine 2.5 years ago on a Pentium 266 with Java 1.2.

      And of course on the server side (servlets vs. CGI) there's no contest.

    60. Re:Serious features seriously needed by mccalli · · Score: 2
      What you want is an abstract class

      No...because then you'd need multiple inheritance again.

      Cheers,
      Ian

    61. Re:Serious features seriously needed by Anonymous+Brave+Guy · · Score: 2
      Java 1.4 has a feature called Generics and it solves the same problem you want to use templates for. It solves the casting issue and is very powerful.

      It solves a casting issue with container classes. It's nowhere close to the power of C++ templates, or the equivalents in many other languages with good compile-time type-deduction systems.

      Please read the spec (or spec summaries) to learn about generics.

      I read it in full when it was first published, and rapidly formed the opinion that while it did solve a useful and common problem, it was mostly hype to cover up a serious omission in Java. I read it again some months later to see if it had improved. I'm afraid it hadn't. Have they now fixed it to cover more than just container classes?

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    62. Re:Serious features seriously needed by cartman · · Score: 2

      > Pointers and direct memory access: Java
      > currently makes it very difficult to write
      > specific machine-targeted instructions. I find
      > it frustrating that I can't wring out every
      > last bit of performance from whatever CPU I'm
      > coding for. The designers of Java really blew
      > that one. Direct memory access with pointers
      > like in Visual Basic and Delphi would be a
      > godsend.

      The _very point_ of java is _never_ to do this!! If you want to use direct access to optimize every last clock cycle, don't use java!

    63. Re:Serious features seriously needed by Prior+Restraint · · Score: 2
      What you want is an abstract class

      No...because then you'd need multiple inheritance again.

      Whoops! I missed that part of the comment. I've been interviewing candidates for an entry-level Java position, and "Tell me about the difference between an interface and an abstract class" is one of my staples. I guess I have that question on the brain.

    64. Re:Serious features seriously needed by cartman · · Score: 2

      The article that you cited was extraordinarily biased in favor of C++.

      There is a great deal of independent research showing that equivalent programmers are more productive in Java over C++.

      The cited article indicates that it takes the same amount of time to _write_ a program in C++ or Java, but the article dismisses the amount of time it takes to debug those programs. The article admits that debugging memory leaks is nasty and time-consuming, but states that "tools exist to help the programmer with this."

      Those tools do not remove the problem. Debugging memory leaks is incredibly time-consuming. Notice that a many commercial products _ship_ with a great many active memory leaks. Even some operating systems have them (Irix 5).

    65. Re:Serious features seriously needed by mark_lybarger · · Score: 1

      There is a great deal of independent research showing that equivalent programmers are more productive in Java over C++.

      can you point some of these out?

    66. Re:Serious features seriously needed by Anonymous+Brave+Guy · · Score: 2
      There is a great deal of independent research showing that equivalent programmers are more productive in Java over C++.

      Cite, please? I've heard lots of people say this, but never yet seen any, other than from obviously pro-Java groups.

      The cited article indicates that it takes the same amount of time to _write_ a program in C++ or Java, but the article dismisses the amount of time it takes to debug those programs. The article admits that debugging memory leaks is nasty and time-consuming, but states that "tools exist to help the programmer with this."

      Well, that is true, and those tools often cut the time taken to fix a memory leak down to minutes or seconds. That said, something that rang very true in the cited article was that Java tends to be more productive for less experienced programmers, then C++ catches up and overtakes it as programmer experience goes up.

      Certainly the average C++ programmer does plenty of dumb things (like using raw pointers and arrays, new and delete all over the place, etc) that a more experienced programmer would simply avoid altogether except in the low-level code where they're justified. That same more experienced programmer is probably smart enough to put in lots of diagnostics to make sure his low level code is rock solid, and as a consequence of these arrangements, he'll usually suffer from no resource leaks at all. In the usual great irony, a less experienced programmer would be more confident in his skill, and probably litter his code with bad style, leading straight to the sort of bugs that Java would prevent.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    67. Re:Serious features seriously needed by cartman · · Score: 2

      > Well, that is true, and those tools often cut the time taken to fix a memory leak down to
      > minutes or seconds. That said, something that rang very true in the cited article was that
      > Java tends to be more productive for less experienced programmers, then C++ catches up
      > and overtakes it as programmer experience goes up.

      I'd be quite surprised if C++ programmers would ever _overtake_ Java programmers in productivity. The biggest difference between the two languages is that Java manages some things for you (garbage collection, etc).

      > Certainly the average C++ programmer does plenty of dumb things (like using raw pointers
      > and arrays, new and delete all over the place, etc) that a more experienced programmer would
      > simply avoid altogether except in the low-level code where they're justified. That same more
      > experienced programmer is probably smart enough to put in lots of diagnostics to make sure his
      > low level code is rock solid, and as a consequence of these arrangements, he'll usually
      > suffer from no resource leaks at all. In the usual great irony, a less experienced programmer
      > would be more confident in his skill, and probably litter his code with bad style, leading
      > straight to the sort of bugs that Java would prevent.

      I don't buy the the argument: "I have experience, so my programs don't have those bugs." I have never met a programmer with sufficient experience to write large, complicated programs that are correct on the first try. Garbage collection eliminates an entire class of bugs automatically. You state the the programmer could put in "lots of diagnostics" to make sure that there are no memory leaks, but even this takes programmer time.

      The "usual great irony" you mention is absolutely correct: inexperienced programmers are far more confident in their ability to write bugless code.

    68. Re:Serious features seriously needed by inkypi · · Score: 1

      Default implementations for interfaces is something that I have really wanted in Java for a very long time. One problem that makes this hard is that two interfaces can define a method with the exact same signature, and one class can implement both interfaces with only one method. What if both interfaces have default implementations? Which one wins? The first or last interface listed in the implements clause? This seems a little hacky to me. Or perhaps we'd have to specify which implementation to use somewhere - probably on a method by method basis. It's tricky. If we go down that route, we might as well do MI, right? Actually, I haven't even convinced myself, really. I think there has to be a way for a language to support the idea that there is a chunk of code, common to two classes, where the relationship is not strong enough to be inheritance, but not weak enough to be simple aggregation. It's a composite. "Give me a class that does everything that this other class does, plus this extra stuff that I am adding, but in the end, treat this as simply a new class". We need this. What's the other language with Mixins? Those sound cool.

    69. Re:Serious features seriously needed by Tablizer · · Score: 2

      (* when developers are given their preferance of language to use to implement a solution, they're most productive *)

      Edward Yourdon's surveys also seemed to suggest this. When OOP was mostly the domain of people who used OO because they liked it (before it was "in"), OOP projects scored better than average on satisfaction surveys. However, when OOP became "mainstream", it's rates plummetted to average, and seemed to stay there for the observation period.

      People think differently. Unless it can be shown that there is One Right Way to think and organize complex software, it would be fair to assume that different philosophies and techniques will favor different minds.

      I wish there was more research into this rather than One Size Fits All thinking that now exists.

    70. Re:Serious features seriously needed by junk95 · · Score: 1

      Add a request for templates (which are by far more powerful than the other three stuff that
      you mention) and you basically have C++.

      But then, why use Java in the first place and
      not C++? Oh, yes, cause it would be written once
      and run everywhere. Believe me, with little syntactic sugar additions like templates,
      pointers, multiple inheritance and DMA, "running
      everywhere" would be pathetic in terms of
      speed. Even JIT wouldn't do.

      There is a good reason why Java lacks half the
      syntax of C++. It is (whatever Sun says) an
      interpreted language[*]. Interpreted languages
      have to be simple, otherwise the interpreters
      become monsters. Period.

      [*] I do not mean that this is bad. Nothing
      personal against interpreted languages, mind.
      It just sounds bad to marketing people.

  7. 0. by Perdo · · Score: 2, Funny

    10. Delete all deprecated methods, fields, classes, and interfaces.
    9. Fix incorrect naming conventions.
    8. Eliminate primitive data types.
    7. Extend chars to four bytes.
    6. Fix threads.
    5. Convert file formats to XML.
    4. Ditch the AWT.
    3. Rationalize the collections.
    2. Redesign I/O.
    1. Redesign class loading from scratch, this time with human interface factors in mind.

    If he's so prolific, and knows exactly what it needs...

    0. Do it himself.

    --

    If voting were effective, it would be illegal by now.

    1. Re:0. by altgrr · · Score: 1, Funny

      try{
      fixInconsistentCapitalisation();
      makeMethodsTakingNoInputsNotRequireBrackets(e,g,St ring.length());
      changeBrackets{
      soYouDon'tHaveCurlyOnes(orSquareOnes[either]);
      }
      finally{
      StopTeachingItInTheUniversities();
      }

      --


      Like car accidents, most hardware problems are due to driver error.
    2. Re:0. by kgroves · · Score: 1

      2. Redesign I/O.
      Again? java.nio.* vs. java.io.*
      8. Eliminate primitive data types.
      7. Extend chars to four bytes.
      A char is a primitive data type.

      --
      *thwock!* *groan* *crash* A horrible roar fills the cave, and you realize, with a smile....
    3. Re:0. by tahirbond · · Score: 0, Troll

      Betcha this one's a VB coder!

    4. Re:0. by Anonymous Coward · · Score: 0
      There are many more important areas than need fixing before "all property files become XML" etc:
      • clone() needs to work with inner classes;
      • clone() needs to work with final fields;
      • clone() needs to be a public method of Clonable;
      • the language needs built-in typesafe enum support;
      • the language needs support for generic types (List<int>));
      • it should be decided once and for all whether final fields could be changed via reflection or not;
      • Externalizable should work with final fields;
      • it should be decided once and for all whether the current or the thread context classloader is used for implicit dynamic resource loading;
      • java.net.URL API needs cleaning up;
      • custom URL schemes need better support;
      • .class custom attributes should be accessible programmatically, via ClassLoader API;
      • covariant return types should be supported;
      • the language should support a proper notion of const-correctness
      Most of the points mentioned by Rusty Harold are things that you stumble over when you write books, whereas the above stem from experience in using Java in large scale project (especially the const problem is my prime candidate when debugging).
    5. Re:0. by altgrr · · Score: 1

      Sorry to disappoint you, but I mainly code Java. Last time I did anything with VB was way back in the day of VB2... and I didn't use no steenking capitalisation either.

      --


      Like car accidents, most hardware problems are due to driver error.
    6. Re:0. by PissingInTheWind · · Score: 1

      There is a good reason why he is pushing 'using XML everywhere': he wrote O'Reilly XML and Java books...

      --

      A message from the system administrator: 'I've upped my priority. Now up yours.'
  8. Compatability requirement by davecb · · Score: 2

    I noted in a comment to the initial article
    that compatability is a requirement, but
    that incompatable features can be added and
    old ones phased out...

    Thus ia actually a solved problem from
    before Unix was written: I learned it from
    a Multician.

    --dave

    --
    davecb@spamcop.net
  9. backwards compatible by bsDaemon · · Score: 5, Insightful

    If people start writing for new java, then people with old java shall get cut out -- the Windows users, more than likely. They are going to have to get new java on there own, and i'm not sure how many people want to. However, they will likely have .NET forced on them anyway. New Java will just encourage use of C# unless it remains backwards compatible.

    1. Re:backwards compatible by greenrd · · Score: 2
      No, you're confusing backwards compatibility with forwards compatibility - the ability to run apps developed for a newer API. No version of Java is forwards compatible, so the problem you mentioned already exists.

      What this article is talking about is breaking backwards compatibility, which means you wouldn't be able to run J3 apps on J2 VMs. This is not so much of a problem for users since they can just use old VMs, It is mainly an issue for developers not users, and non-stupid developers are not going to choose between platforms based on whether they have to click a few times to download a new development kit or whether it's already installed.

  10. The Smalltalk way about numbers is right by r6144 · · Score: 3, Interesting
    Removing unsigned types is a good idea when doing computation, so that bad code like unsigned i; for (i = count-1; i >= 0; i--) foo(i); won't happen. However, it is a Bad Thing when doing I/O --- I have to use Long, or use some even more kludgy ways.

    So I say the Smalltalk way is easier to use, there is only one integer type when doing computation, yet I can do I/O with integers in all formats I want (8-, 16-, 32-, or 64-bit, signed or unsigned, big-endian or little-endian). If high performance is required, maybe C-like types can be added too, used only in speed-critical things.

    1. Re:The Smalltalk way about numbers is right by pslam · · Score: 1
      Removing unsigned types is a good idea when doing computation, so that bad code like unsigned i; for (i = count-1; i >= 0; i--) foo(i); won't happen.

      Any compiler worth its salt will see "i >= 0" and will give a warning "Range comparison is always true". As a bonus, if you do allow unsigned types, "i Unsigned types also improve performance on most processors. Division by a power of 2 is just a shift if it's unsigned. With signed numbers it's a shift, compare and conditional add. This optimisation cannot be determined at compile time unless you define the type as unsigned.

      The only architecture I can think of where unsigned types are slower is Motorola 56k, which has so many other things wrong with it that it's not surprising. It's certainly (significantly) faster to use unsigned where possible on all non-DSP-oriented processors I can think of (x86, ARM, PPC, 68k, PIC, 6502...)

    2. Re:The Smalltalk way about numbers is right by Alt_Cognito · · Score: 0

      Processors are so fast now adays that talking about the difference between dividing by 2 and shifting a bit is kinda silly since most people are not optimising their code at this level unless they are doing low-level drivers or some other truly intensive operation.*

      * Or they work at some academic institution.

    3. Re:The Smalltalk way about numbers is right by Anonymous Coward · · Score: 0

      C-like types in Java? Umm, ALL primitive types in Java are signed, except for boolean and char.

      Further, the size of the data types is guaranteed, both min and max bit size. That's not guaranteed in C.

      I'm curious as to how this "insightful" comment came to the conclusion that signed data types are computationally faster. The code that gets emitted from a compiler, whether working with signed or unsigned types, is the same speed. It just uses a different ISA instruction that either uses or ignores the sign extender unit in the CPU.

      This is like CS 101 stuff. You might pull something more "insightful" out of your ass if you did a little research first.

    4. Re:The Smalltalk way about numbers is right by Creepy · · Score: 2

      Actually, he probably is talking about a compiler optimized divide by 2, not hand coded. All compilers I know of do this for you these days.

      Another thing that could cost cycles is a bad compare guess in the pipeline (something you don't need to do for unsigned), which would result in a pipeline flush.

      It does add up, but not enough that most people outside of academia and government would care. This used to be significant in games, but now most games use parallel floating point calls (floating and integer units run independently) or high speed multimedia extensions, so its importance there is very much diminished. I remember this being meaningful when I wrote a (not very pretty) flight sim about 8 years ago, but wouldn't worry about it at all, anymore (for a flight sim, at least).

    5. Re:The Smalltalk way about numbers is right by Fjord · · Score: 1

      I've never understood why people can't work with the signed Java types. I've done a lot of complicated bit related code and I've found that, because of the >>> (unsigned bitshift) operator, there's no difference in using a signed type where I would normally use an unsigned one.

      Can you give me some examples that are more difficult when you only have signed types?

      --
      -no broken link
  11. Who would benefit? by joe_fish · · Score: 2, Insightful
    Not Sun, many people would take the time to jump to C# rather than Java3

    Not the users. IN GENERAL the cost the rework would be greater than the cost of the benefits of additional clarity.

    I think the only real beneficiaries would be the Book authors, who would make a killing from killing trees to feed the poor confused users.

    Now I wonder which camp ERH comes into...

    1. Re:Who would benefit? by CarrionBird · · Score: 1

      The textbook authors gotta have a reason to make new revisions, ya know.

      --
      Free Mac Mini Yeah, it's
    2. Re:Who would benefit? by pmz · · Score: 2

      Not Sun, many people would take the time to jump to C# rather than Java3

      This isn't true. There is no advantage to migrating to C# over a new version of Java. The amount of work to move to a Java 3 would be substantially less than moving to C#. Note that the article mostly talks about just stripping out deprecated material from the Java API and cleaning things up. A few of the points are major changes, but they shouldn't cripple most Java-based projects.

      Not the users. IN GENERAL the cost the rework would be greater than the cost of the benefits of additional clarity.

      An introduction of a Java 3 doesn't mean Java 2 just dies off. Sun will have to support both for several years. Existing projects can go on as if nothing changed, and new projects can start with the latest version of Java.

      This is nothing new to software development. Just be thankful that Java has been pretty non-volitile over the years. Compare this to Microsoft's tendency to put its tools through a two-year turnover cycle.

    3. Re:Who would benefit? by joe_fish · · Score: 2
      Well there will be an easy way to see who is right. If Sun does do Java 3, and people switch to it then I guess you will be proved right. Until then I think the C# jump is close enough to keep Sun away from Java 3, and the re-write cost enough to keep the users from being happy, which will also keep Sun away.

      Note Java 3 = "new version of Java that is not compatible with Java 2" for the purposes of this debate. This is NOT the way Sun names things though. Java 2 is fully backward compative with Java so the title is somewhat deceptive. Sun use major versions in the JDK to denote compatibility.

  12. VMs play second fiddle to virtualization by Anonymous Coward · · Score: 0
    I've been programming in Java for seven years now, and while it's far from the swiss army knife of compatibility that has been touted the language features are far more robust than any other language out there.

    One thing that desperately needs to be done to increase the speed of Java is dynamic translation of the binaries to the format of the native platform. This works well for emulation and the AS/400, and the results could even be cached for quicker load times on the next run. Additionally, it's high time for specialized 'Java' expansion boards to arrive; we accelerate MPEG4, and I believe that providing the option of speeding Java binaries past the execution speed of native binaries would be a huge boon to Sun and developers. Finally, the ability for applets to access ActiveX controls on the remote system would greatly enhance the ability of developers to roll out content such as custom movie viewers and embedded controllers. Completely necessary if it's going to reclaim some of the webspace lost to Flash, IMHO.

    Virtualization techniques could also speed things up overall, perhaps to the point of making multiplayer OpenGL via Java a reality. Java 4, perhaps?

    1. Re:VMs play second fiddle to virtualization by jbolden · · Score: 1

      Active X runs with system privs on NT. Allow Java to access Active X and Java is now no longer safe.

      Allow Java to have Windows ask the user if the Java app can pass data to an Active X control; or have it ask the user if its OK to install and Active X control I can sorta live with. But Windows not the app has to be in the driver's seat.

      Finally if you use Active X you break client independence and then why use Java at all?

  13. Open Source JVM by Anonymous Coward · · Score: 0

    I know I know

    1. really a clean multi arch small JVM would be really nice (somthing like the KVM) as a ref which is not encumbered by signing up to use SUN's software just that you will contribute any work back

    2. classpath actually working well (needs a good maintainer)

  14. primitive data types... by Anonymous Coward · · Score: 1, Funny

    The reason Java used primitive data types in the first place was speed. Oh how they failed.

  15. The "most controversial" proposal by CaptainAlbert · · Score: 4, Insightful

    Number 8 -

    > Eliminate primitive data types.

    > This will undoubtedly be my most controversial
    > proposal, but bear with me.

    I can agree with almost every other proposal in this article, but he's right - this one will cause a fracas.

    > I am not talking about removing int, float,
    > double, char, and other types completely. I
    > simply want to make them full objects with
    > classes, methods, inheritance, and so forth.

    One word - ew!

    > This would make Java's type system much
    > cleaner. We'd no longer need to use type-
    > wrapper classes to add primitives to lists and
    > hash tables. We could write methods that
    > operated on all variables and data.

    What you really need is generics (as in C++ templates). Java collections are vile, since they suffer from type loss even when used with "real" objects. I'm surprised that didn't come into this top ten; it's a major language deficiency.

    > All types would be classes and all
    > classes would be types. Every variable, field,
    > and argument would be an instance of Object.
    > Java would finally become a pure object-
    > oriented language.

    However, that wouldn't make all Java programs "object-oriented programs", nor would it make all Java developers "object-oriented programmers". I have a suspicion that it might impact things like the JNI too.

    > Programmers in each environment need a language
    > tailored for them. One size does not fit all.

    <ahem> Quite. That's why you don't start an exercise in OOD by deriving everything from "TObject". :)

    --
    These sigs are more interesting tha
    1. Re:The "most controversial" proposal by Westley · · Score: 5, Informative
      What you really need is generics (as in C++ templates). Java collections are vile, since they suffer from type loss even when used with "real" objects. I'm surprised that didn't come into this top ten; it's a major language deficiency.

      The article was about what can't be built on top of Java2. As Java2 (in 1.5) will be getting generics, I'm not surprised this was left out of the article. I believe there may well be some automatic boxing if you wish to use it, e.g.

      List<Integer> x = new List<Integer>();
      x.add (5);

      but it's all up for debate at the moment of course...

      Jon

    2. Re:The "most controversial" proposal by davecb · · Score: 2, Interesting

      > This would make Java's type system much
      > cleaner. We'd no longer need to use type-
      > wrapper classes

      Actually Smalltalk solved this problem
      by always executing the machine code
      primitive for, for example, integer add.
      If this failed an assertion, it faulted out
      to the more general class code.

      Substantially the same thing could be done for
      Java, so that one could have full generality
      without a performance penalty.

      --
      davecb@spamcop.net
    3. Re:The "most controversial" proposal by jtdubs · · Score: 5, Insightful

      > One word - ew!

      Why ew? Because of your limited programming experience with languages where this was eschewed?

      In general, in computers, closure is a good thing. Ask any functional programmer. Ask any language theorist. Closure is good. To simplify closure, I am referring to having rules that don't have exceptions. Having a uniform representation for as much as possible.

      In LISP data and code are stored the same way, as lists. This is the ultimate closure. Other languages implement other closures like having all data types be of a common type.

      > What you really need is generics (as in C++ templates).

      Lord God NO! Don't you EVER use C++ templates as an example of generics again. C++ templates are an attrocity. What you want is generic methods with multiple-dispatch. Look at Lisp's CLOS, or Dylan.

      > However, that wouldn't make all Java programs "object-oriented programs",

      Explain? How can you write a Non-OO program in a Pure-OO language? Cause, you see, it's not possible. You can write a program that isn't in the OO style that you think of when you think of OO. But you can't write a program that has data that isn't an "object" in a Pure-OO language.

      > I have a suspicion that it might impact things like the JNI too

      JNI would be as fine as it is now (yuch). Even the "float" class has to have an internal variable that actually stores the float.

      Justin Dubs

    4. Re:The "most controversial" proposal by mindriot · · Score: 2
      > What you really need is generics (as in C++ templates).

      http://www.cis.unisa.edu.au/~pizza/gj/

      This was intended to be added into Java, I suppose it hasn't (haven't checked 1.4 though).

    5. Re:The "most controversial" proposal by affenmann · · Score: 3, Interesting

      > What you really need is generics (as in C++ templates).
      >Java collections are vile, since they suffer from type loss
      > even when used with "real" objects. I'm surprised that didn't
      >come into this top ten; it's a major language deficiency.

      I couldn't agree more. In fact, there is a proposal (from Sun in 2001 based on Generic Java) to do just this. I really hope it will find its way into Java soon, since Generic Java solves exactly the problem you are rightly complaining about.

      Java does not need just to incorporate the advances in the last 7 years, but rather the advances (e.g. in type systems) of the last 20 years.

    6. Re:The "most controversial" proposal by Richard_Davies · · Score: 2, Interesting
      > What you really need is generics (as in C++ > templates). Java collections are vile, since they > suffer from type loss even when used with "real" > objects. I'm surprised that didn't come into this > top ten; it's a major language deficiency. I can think of 2 reasons why they weren't in this article:

      Generics will will be included in Tiger (1.5)

      They don't break either source or binary compatibility (at least not the way Sun is going to do them).

      You can even download the beta compiler and give it a whirl if you're eager. Java Generics

    7. Re:The "most controversial" proposal by CaptainAlbert · · Score: 5, Interesting

      > > One word - ew!
      > Why ew? Because of your limited programming
      > experience with languages where this was
      > eschewed?

      Nope, just flamebait :)

      > Explain? How can you write a Non-OO program in
      > a Pure-OO language?

      I'm not sure what your question really is here, and you seem to have answered it yourself. You can take your problem, use structured design / functional decomposition to come up with a solution circa 1980, then implement it in Java much as you would do in C. A single class, with many methods and members (hell, make 'em static while you're at it)... no polymorphism, no inheritence, no data hiding, no application-level abstraction.

      You can go one step back up the ladder and pretend to be using Pascal/Modula2/Ada, using classes as abstract data types and providing simple access functions. Still not what most people would call an "object-oriented" program.

      Remember, design *is* programming. A program which deliberately avoids the object-oriented features of its implementation language cannot be called OO just because it "contains objects". A good language is one which allows the programmer to express him/herself in the most suitable way for the problem being solved. If a developer has to find "ways around" a particular feature of the language, then that language is flawed.

      Me? If I was asked "what is the most harmful programming construct", I would choose type casts every time - yes, even over gotos and pointers.

      As you've probably guessed, I like C++. I tried Java and didn't like it. Therefore, I am just ranting bitterly and should be ignored at all costs. :))

      --
      These sigs are more interesting tha
    8. Re:The "most controversial" proposal by Anonymous Coward · · Score: 0

      There is nothing wrong with C++ templates.
      Java Generics is braindead. Atomic types (int, float, double, etc) are second class citizens in Java.
      At least C++'s templates do have the closure you describe - objects or atomic built-in types can be used interchangably in templates.
      Java's Generics (GCJ) ought to do no less - but the proposed implementation cannot without changes to the JVM which Sun is not prepared to do.

    9. Re:The "most controversial" proposal by pfdietz · · Score: 1

      I can agree with almost every other proposal in this article, but he's right - this one will cause a fracas.

      I am not talking about removing int, float, double, char, and other types completely. I simply want to make them full objects with classes, methods, inheritance, and so forth.

      One word - ew!

      Lisp (and Smalltalk?) solved this problem on integers ages ago. You represent small numbers (fixnums) in such a way that you can distinguish them from pointers. Most arithmetic will be fixnums (typically 29 bit values). You do the arithmetic assuming fixnums and branch to the general code on overflows. In non-statically typeed languages this is a harder job because you have to be able to distinguish a fixnum from anything, not just from bignums. If you know the result is a fixnum (say, because you declared the integer to have only 16 bits) you needn't even check for overflow.

      In more detail: the integer x is actually stored as x shifted left 3 positions. Pointers have an extra 1 or 3 and-ed into them; you take this off with small offsets when derefing the pointer. The Sparc had instructions that did addition and subtraction but also trapped on the low bits, so you could check if you were trying to add to a non-fixnum with no extra check instructions. These instructions have been deprecated, alas.

      You might want separate types that are 'integers mod N' for N being various convenient powers of two.

    10. Re:The "most controversial" proposal by CynicTheHedgehog · · Score: 2

      I don't think getting rid of primitives is realistic. What would you use to index arrays with? Objects? So arrays would inherently be hash maps? What kind of performance impact would that have?

      Furthermore, Java doesn't support operator overloading. I don't think it should, and I hope it never does. Converting primitives to objects would make such a kludge necessary, making what now seems somewhat inconsistent seem totally inconsistent.

      And like you said, this would probably have a major impact on things like CORBA and JNI, since primitives are a part of IDL.

    11. Re:The "most controversial" proposal by Esarel · · Score: 1

      One of the stated assumptions of the article was that you could ignore performance issues. You just expect computers to be fast enough to cover up all of the poor decisions you make. As for operator overloading, if you can read: Object1.add(B,Object1.subtract(Object1.multiply(E, A),C)) as easily as B + E*A - C then you don't need it. Operator overloading can be extremely useful for the rest of us. At least when it is properly used.

    12. Re:The "most controversial" proposal by jtdubs · · Score: 2

      I think this is a problem of terminology.

      A program that "contains objects", and is composed entirely of said "objects" CAN be considered OO, no matter what.

      Style has nothing to do with classification.

      Whether you use data-hiding, inheritance, encapsulation, polymorphism, [insert OO buzz-word here], is up to you.

      It's still OO if your language is Pure-OO. That's what the name Pure-OO means for god's sake.

      Yes, it might not be good OO-style. It may not be XP. But, good OO-style and XP are both fads. They have only been around for a few years and probably won't be around in the same form in a few more.

      You can't say something isn't transportation because it doesn't get you to your destination the way you want to get there. It's transportation as long as it gets you there.

      But, I do understand your point about Pure-OO languages not necessarily leading to GOOD OO programs. And I agree whole-heartedly. No language can make you a good programmer.

      Justin Dubs

    13. Re:The "most controversial" proposal by lscoughlin · · Score: 1

      You can absolutely write a Non-OO program in a Pure-OO language.

      each "class" is used only as a namespace for static functions and embedded classes that only contain public fields.

      Then start writing in nice happy procedural method or some such thing.

      -T :)

      --
      Old truckers never die, they just get a new peterbilt
    14. Re:The "most controversial" proposal by lscoughlin · · Score: 1

      Wow.

      Um.. lets try this statement.
      How can something not be a bolt if you used a wrench to put it in.

      Well, i have a long history of using wrenches that were handy to pound in nails. That doesn't make the nail a bolt.

      Design dictates the style of the program, not the features of the language. Just like a wrench used to bash in a nail, doesn't make a nail a bolt.

      If i write a structured procedural program in a Pure-OO language, it remains, a structured procedural program, and none of the features of the language can change that.

      Granted, it's pounding a nail in with a wrench, but it's still a nail, not a bolt.

      -T

      --
      Old truckers never die, they just get a new peterbilt
    15. Re:The "most controversial" proposal by jtdubs · · Score: 2

      I still disagree.

      You CAN'T write a structured procedural program in a Pure-OO language like java without having those procedures be class methods.

      Since all of your procedures are now class methods, your program is in a object, and hence, object-oriented.

      You CAN NOT write a NON-OO program in a PURE-OO language. It CAN NOT BE DONE.

      It may not be the style of OO that you are used to. In fact it may very well be a dirty hack of reimplementing a procedural program in an OO language with the least amount of code change possible.

      It may be all public and disobey every rule of good OO design you've ever learned.

      But, if it's composed of nothing but classes with methods, then it's Object Oriented. This is just a fundamental definition of the term Object Oriented as meaning comprised of Objects where objects are instances of classes. And in C++, yes, classes are very similar to namespaces, which are just buckets for methods and variables, but, guess what, that's all classes are too.

      Again, it's a terminology problem. It's the difference between an OO program and a program written in a OO style. You MUST write an OO program when using a pure OO language. But you need not use OO style. You can write OO programs in a non-OO style. You cannot write non-OO programs in a pure OO language.

      Justin Dubs

    16. Re:The "most controversial" proposal by swillden · · Score: 2

      A program that "contains objects", and is composed entirely of said "objects" CAN be considered OO, no matter what. Style has nothing to do with classification. Whether you use data-hiding, inheritance, encapsulation, polymorphism, [insert OO buzz-word here], is up to you.

      Excuse me, sir, but you have no clues.

      Different approaches to software design exist not because it's cool or fun to have them, and in spite of what the cynics say, not even just to make money for those that promulgate them. They exist to make software development more manageable.

      All those OO "buzzwords" you mention are precisely the reason that OO was invented. Most of those concepts predate the "OO" languages, and good programmers used many of them prior to the existence of the languages. Good programmers still use them when writing programs in, for example, C. The OO languages came along later, because writing OO code in a non-OO language requires you to do a lot of bookkeeping yourself, which clutters the code and reduces the benefits.

      The same holds for structured programming. x86 Assembler is not a structured programming language, but you most certainly can write structured code with it. Or OO code.

      These design approaches are all about structuring your code in particular ways in order to make it more maintainable, flexible, extensible, etc. The implementation language is irrelevant, other than insofar as some languages take care of some of the scutwork for you, and others don't.

      If you write a stinking mess of spaghetti code in Java, C++, Eiffel, Smalltalk, CLOS, etc., your code is not OO. Spaghetti code in Modula-2, Ada95, etc, is not structured. An OO structure is OO whether implemented in C, Assembler, or C++.

      Oh, and one semi-obscure nit: Inheritance has nothing to do with object orientation. Inheritance is a common implementation approach that many (but not all) OO languages use to provide polymorphism and/or generalization/specialization. For example, inheritance is the only language-supported way to achieve polymorphism in C++ and Java, but isn't necessary for polymorphism at all in Smalltalk-style languages. Inheritance is mainly for generalization/specialization in Smalltalk-style languages. There exist OO languages that don't have any notion of inheritance; extension is done by composition and interface "exporting".

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    17. Re:The "most controversial" proposal by bmetz · · Score: 2

      >In general, in computers, closure is a good thing. Ask any functional programmer. Ask any
      >language theorist. Closure is good. To simplify closure, I am referring to having rules that
      >don't have exceptions. Having a uniform representation for as much as possible.

      You clearly have never used perl :)

      --
      What did you eat today? http://www.atetoday.com/
    18. Re:The "most controversial" proposal by battjt · · Score: 2

      Primatives should be teatable like objects, so 5.add(7) is equivalent to 5+7. But I want to be able to 5.toString() or myHashMap.put(5, 9)! Let the compiler work it out. This is not new technology, Smalltalk has been doing it for 20 years.

      Joe

      --
      Joe Batt Solid Design
    19. Re:The "most controversial" proposal by jtdubs · · Score: 2

      I call the buzzwords because they predated and will eventually post-date the fad of OO programming and yet are always used in relation to OO. I full know well what they mean. I've been doing OO programming for almost 10 years.

      No, you can not write OO in assembler. To do so would require doing all of the bookkeeping by hand with regular variables. In which case you have implemented an OO framework on top of assembler. In which case you are actually programming in the meta-language you implemented on top of assembler.

      I realize i'm being pedantic here, but it's a matter of terminology. OO code is code that uses objects, whether or not those objects are themselves messes of spaghetti code. OO style is a method of writing objects that take advantage of the OO buzzword list.

      OO style can be written in any language, including assembler, C, Pascal, you name it.

      OO code however can only be written in an OO language.

      If you implement an OO framework on top of assembler then you are actually programming in your framework, which is an OO meta-language.

      Justin Dubs

    20. Re:The "most controversial" proposal by faichai · · Score: 1

      > Java, so that one could have full generality
      > without a performance penalty.

      Except you still have the added assertion no?

    21. Re:The "most controversial" proposal by csrhodes · · Score: 1
      In LISP data and code are stored the same way, as lists. This is the ultimate closure.
      This is mostly true, though I feel it's probably necessary to make the point that these days Lisp code tends to be compiled to machine code, so in that sense data and code are not at all stored in the same way. Where this statement is true is that during the act of compilation the parse tree is effectively exposed to the programmer, who can manipulate it easily using built-in list operations.

      It's possibly also worth noting that not all closures are necessarily seen as a good thing; for instance, while the concept of generic functions exists in Common Lisp, most of the built in functions cannot have methods written for them; in other words, they're not generic. Why not? For practical, efficiency reasons; you don't want to have a call of the form
      (+ x y)
      to go through a type test, as it would have to were the function "+" available for redefinition.
    22. Re:The "most controversial" proposal by funkman · · Score: 2

      Anyone else find number 8 contradictory (Funny)?

      I simply want to make them full objects with classes, methods, inheritance, and so forth

      ... Stuff ...

      The classes would probably be final for reasons of both safety and performance.

      If they are final - isn't many of the advantages of making them an object now gone?

    23. Re:The "most controversial" proposal by bellings · · Score: 1

      In general, in computers, closure is a good thing. Ask any functional programmer.

      Your point would be stronger if you explained that the definition of "closure" you're using is entirely different than the definition of "closures" used by functional programmers.

      What you want is generic methods with multiple-dispatch. Look at Lisp's CLOS, or Dylan.

      I must be dense, but I don't have a clue how C++ templates are related to generic methods, or to multi-dispatch. C++ templates are truly hideous, but the ideas inherited by most "generics" implementions in Java compilers I've looked at haven't looked too bad.

      Explain? How can you write a Non-OO program in a Pure-OO language? Cause, you see, it's not possible

      Aighhhh!!! I've been trolled!!!! I've replied to a fucking troll! God damn it! Fuckity Fuck! Now, I'm going to have to cover myself in leaches, to get rid of all the bad blood that's coursing through my body! I hate it when I reply to trolls!

      --
      Slashdot is jumping the shark. I'm just driving the boat.
    24. Re:The "most controversial" proposal by Anonymous Coward · · Score: 0

      A pure OO language won't have static functions or public fields.

    25. Re:The "most controversial" proposal by swillden · · Score: 2

      I've been doing OO programming for almost 10 years.

      10 years? Yes, I believe it. Your inexperience shows. I might point out that this "fad" has been around for nearly three times your "age" as a programmer. It didn't become mainstream until about 10 years ago.

      No, you can not write OO in assembler. To do so would require doing all of the bookkeeping by hand with regular variables. In which case you have implemented an OO framework on top of assembler. In which case you are actually programming in the meta-language you implemented on top of assembler.

      You continue to confuse language with structure.

      I realize i'm being pedantic here, but it's a matter of terminology. OO code is code that uses objects, whether or not those objects are themselves messes of spaghetti code.

      That is your definition, but not one that many would share. Can you support this argument with references from literature?

      OO style can be written in any language, including assembler, C, Pascal, you name it.

      Absolutely. And using the "style", as you call it, provides 75% of the benefit. The syntactic sugar and bookkeeping provided by the language are of lesser value.

      OO code however can only be written in an OO language.

      Again, you are providing a *definition* here, of what *you* mean when *you* use the term.

      Hello, Humpty Dumpty.

      If you implement an OO framework on top of assembler then you are actually programming in your framework, which is an OO meta-language.

      Are you presuming some set of macros that implement this framework? That's convenient, and a good idea, but not strictly necessary. It is entirely possible to write objects in the style of C++ directly in assembler. Granted, if you wanted to implement some Smalltalk style of message-passing you'd have to construct a framework.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    26. Re:The "most controversial" proposal by CaptainAlbert · · Score: 2

      >OO style can be written in any language, including assembler, C, Pascal, you name it.

      > OO code however can only be written in an OO language.

      This is a distinction which I've never heard made before. I don't believe that it holds water.

      By the duck argument: If it looks like an OO program, and it quacks like an OO program, then it's an OO program. If it neither looks nor quacks object oriented, then it's not. The language is merely the vehicle for expression.

      Doing OOP in a language which doesn't support it is a nuisance, and writing non-OO code in a language which is "purely OO" can also be so. I spent some time writing OO code in ANSI C, then gave up because manually maintaining a "this" pointer is messy, error prone and a waste of my time when I can get a machine to do it for free. And don't even bother trying vtbls and runtime type identification without language support.

      And yes, I've been in the position of inheriting some non-OO code (K&R C, in fact) and having to munge it into an OO framework. Yes, you do end up with some objects whose methods are just spaghetti, but by abstracting those functions behind a suitable class interface (i.e. encapsulation), you get some modules which can be used in an object-oriented application. You can go ahead and instantiate many objects of those classes, and they all function independently. But I *still* would not go as far as to call it object-oriented code.

      Because it doesn't quack.

      --
      These sigs are more interesting tha
    27. Re:The "most controversial" proposal by Anonymous Coward · · Score: 0

      Until today I've never heard of the distinction between "OO code" and "OO style".

      What about a program in java that uses no objects, except for one class to hold main and any other methods? Is that non-OO style with OO code?

    28. Re:The "most controversial" proposal by jtdubs · · Score: 2

      Yes, OO has been around that long. Almost 30 years now. But as I'm only 21 that doesn't do me much good. :-).

      I am not confusing language and structure. If anything it is, again, a problem of terminology. Perhaps my definitions, as you point out, are not mainstream. They made perfect sense to me and seem to follow from the composition of the term "object-oriented" but it is possible that they are not mainstream.

      You are correct that the benefit comes from the style, not the language. The bookkeeping, however, is not of lesser value. It is necessary (more or less). It's just a question of whether you implement it yourself or whether the compiler and language do it for you.

      While OO is probably not a "fad" in the way you refer to it, in another sense it is. OO has become such a buzzword itself that many people get lost and assume that OO IS programming. That procedural programming is somehow antiquated and OO is the way of the future.

      I suppose that's possible. But if it's true then I'm ashamed to be a programmer. I've used over 30 languages in my short time as a programmer and am very familiar with the concepts involved. OO, atleast in almost all current implementations, in severely limited. Even more so in Java where it's a damned shame that they diluted the term OO by using Java as an example.

      Anyway, I see your point about my terminology and I apologize for the confusion. I hope you can see the point I was trying to make about the separation of built-in functionality and home-grown functionality, of language and style.

      The future, in my mind, is with a separation of data from algorithms. Data exist in the forms of classes with a mostly common interface. They provide no functionality, only server to wrap up data. Algorithms exist as generics (Generic Methods, called via Multiple Dispatch).

      This gives you all of the benefits of OO with none of the problems.

      OO is a valiant attempt to allow for polymorphism, but in my mind one that is doomed to fail. It will likely be replaced slowly and evolutionarily as programmers hate paradigm changes because they invalidate all that they have learned.

      Justin Dubs

    29. Re:The "most controversial" proposal by Inoshiro · · Score: 2

      "
      > hash tables. We could write methods that
      > operated on all variables and data.

      What you really need is generics (as in C++ templates).
      "

      No, he missed it. OO has a great feature called polymorphism. Granted, templates can work better (less code to write) for small situations, but for large, complex situations where different types do need to be handled differently, polymorphism is the answer he's looking for.

      Templates for powers will work great on all number types where the power operation is the same, but when you need to also have a member which takes strings and converts and powers and converts back and returns that, you'll want polymorphism.

      --
      --
      Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    30. Re:The "most controversial" proposal by cartman · · Score: 2

      > I don't think getting rid of primitives is
      > realistic.

      It is very realistic; it has been done successfully in several languages.

      > What would you use to index
      > arrays with? Objects?

      You would index arrays with integers (objects).

      > So arrays would
      > inherently be hash maps? What kind of
      > performance impact would that have?

      No, an array would not be a hash map. A hash map allows dynamic insertions/deletions and stores by a hashing function, whereas an array is a continuous region of memory. Objects would present no performance impact, since the compiler could easily "convert" the object integer index into a primitive as necessary.

    31. Re:The "most controversial" proposal by Broccolist · · Score: 2
      If I was asked "what is the most harmful programming construct", I would choose type casts every time - yes, even over gotos and pointers.

      Sure, we've all seen programs where casts were horribly abused (in my case, from one of my CS profs :). But casting is a necessary feature: I'm sure that, as much as you hate it, every so often you've been forced to do a dynamic_cast, because it's the only reasonable solution. Casting should be discouraged, but I don't see how it can be removed from a language like C++ or Java. As for gotos and pointer arithmetic, they can be eliminated completely (and indeed, Java did so).

    32. Re:The "most controversial" proposal by cartman · · Score: 2

      > OO has a great feature called polymorphism.

      > Templates can work better (less code to write)
      > for small situations....

      Templates are _not_ meant as a substitute for polymorphism! The two are _not_ related!! I keep seeing this brought up. Templates are meant to resolve the current type unsafety of collections (and related) classes! This is a problem that _cannot_ be solved with polymorphism. Polymorphism and generics are not the same thing and do not exist for the same purpose!!

    33. Re:The "most controversial" proposal by p3d0 · · Score: 2
      How can you write a Non-OO program in a Pure-OO language? Cause, you see, it's not possible. You can write a program that isn't in the OO style that you think of when you think of OO. But you can't write a program that has data that isn't an "object" in a Pure-OO language.
      What does this mean exactly?

      If a program is not in the OO style; if it doesn't decompose a problem by data abstractions; if it doesn't solve problems using encapsulation and polymorphism; then just what exactly do you mean when you say that data is an "object"?

      (I don't mean that question rhetorically--if you have an answer, I'd like to hear it.)

      If you believe you can't write non-OO programs in an OO language, then I envy you the coworkers you must have had. :-)

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    34. Re:The "most controversial" proposal by p3d0 · · Score: 2
      If they are final - isn't many of the advantages of making them an object now gone?
      Nope. They still have classes and methods. They can still inherit (though user classes can't inherit them).

      There's a lot more to classes than what you quoted; yet even by those meagre criteria, final classes still qualify.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    35. Re:The "most controversial" proposal by Anonymous Coward · · Score: 0

      > No, you can not write OO in assembler. To do so would require doing all of the bookkeeping by hand with regular variables. In which case you have implemented an OO framework on top of assembler. In which case you are actually programming in the meta-language you implemented on top of assembler.

      Just because you have to do all the bookkeeping doesn't make that OO-ass'y program non-OO; what it *does* mean is that OO-ass is a Hell of a lot of work to code in :-).

      OO code is code that uses OO techniques, not just "objects". Your pedantry is technically incorrect.

    36. Re:The "most controversial" proposal by swillden · · Score: 2

      But as I'm only 21 that doesn't do me much good. :-).

      Ach! I knew you were green, but I didn't realize you were that green. I'll be nicer.

      You are correct that the benefit comes from the style, not the language. The bookkeeping, however, is not of lesser value. It is necessary (more or less).

      You're speaking to someone who has worked on large software applications (>300Kloc) written in C using an object-oriented style. The bookkeeping is not necessary, and actually not even as much help as you might think it is. It *is* useful, but it's not essential.

      There are a substantial number of experienced programmers in the world who like OO, but don't like any of the OO languages. Basically, they see C++ as too complex and ugly, Eiffel and Ada99 as too obscure and, hence, non-portable, and everything else as too slow (I'm not one of them, BTW, I like OO languages).

      While OO is probably not a "fad" in the way you refer to it, in another sense it is. OO has become such a buzzword itself that many people get lost and assume that OO IS programming.

      Agreed. I think you yourself have fallen partially into this faddish trap, in believing that the language used has relevance to the style used.

      That procedural programming is somehow antiquated and OO is the way of the future.

      First, nearly all OO programming is procedural. I think you meant to say "that traditional structured programming is somehow antiquated." For examples of non-procedural programming, look to functional and declarative languages, like FORTH and Prolog. For a "hip" example, check out XSLT, which is mostly declarative but with procedural bits.

      If you're not familiar with the different types of languages, I highly recommend that you take some CS courses covering them. A little experience with non-mainstream languages like Scheme, SNOBOL, ML, CECIL, etc. can really crystallize your understanding of the different styles and idioms and the tools that support them. You mentioned multiple dispatch in your post, though, so you may have seen some of them.

      However, I think that you're going to find that OO is not a fad that is going to go away. OO is better for most general-purpose computing than structured. The binding of data to algorithm has arisen as the dominant model of software development after twenty years of solid industry experience with the other model. Why did people change? Because they're stupid? Not at all. Young engineers tend to get caught up in the hype but by and large older engineers don't change unless there are good reasons (and sometimes not even then!).

      That said, I think I mostly agree with you about where things are heading, except that your terminology is a bit off. Smarter data, with general-purpose, abstract interfaces (ala XML) is going to be important. I don't know if multiple dispatch will really be all that important; it's nifty but a little too clever for widespread use -- although multiple dispatch leads to some very clean, elegant designs it can create some very hard-to-track bugs.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    37. Re:The "most controversial" proposal by jtdubs · · Score: 2

      Haha. No need to play it nice. :-)

      I think OO is a fabulous concept, but I am more in favor of higher level languages. I think LISP's CLOS has the best object model I've used. Classes with slots. Accessors. Generics w/ multiple dispatch.

      I find C++ limiting due to its lack lf runtime type checking, which disallows some of the more elegant solutions to problems and gives rise to the need for such hacks as the Visitor "pattern."

      As Paul Graham, the LISP guru, so elegantly put it (this is NOT verbatim):

      "I don't like patterns. When I see patterns in my code it means I'm not working at a high enough level of abstraction."

      I disagree that I've fallen into this "faddish trap." I've used C, C++, Assembler, Prolog, Scheme, LISP, Ada, SML/NJ, OCaml, Fortran, Cobol, Pascal, BASIC, Java, Perl, Python, Ruby, Eiffel, Erlang, Forth and far more languages that I can't pull off the top of my head.

      Language has nothing to do with style. Some languages just take care of more of the work for you and abstract you more from the underlying machine.

      You CAN write "OO-style" code, meaning code that exhibits features such as polymorphism, data-hiding, encapsulation and such in absolutely any language. You can do XP style programming in any language.

      But you can't do OO unless you have Objects, which you can't do unless you have a language that has objects, unless you make them yourself, in which case you've changed the "core" language.

      Then again, this is probably just semantics. I can't find the right way to express this belief.

      I am more than familiar with the different styles of programming. From structured programming to OO, from procedural to functional to concurrent, from static scoping to dynamic scoping, from compile-time to run-time binding, from eager to lazy evaluation. I may be green, but I am a fast learner.

      I think I actually agree with everything you say, and I think you'd agree with most of what I say, surprisingly. It's just my lack of communication skills today that may be letting us down.

      Regardless, thanks for the feedback.

      Justin Dubs

    38. Re:The "most controversial" proposal by Anonymous Coward · · Score: 0

      Your sue of all caps to shout at us does not change the fact that "object-oriented" as you've defined it, is a useless term. If your program has one object, with a single static method named "DoStuff", it is no more oriented toward objects than a program without the object. It is only when the use of objects makes some difference in the programs design that it will be considered object-oriented by me or anyone else with any sense.

    39. Re:The "most controversial" proposal by Anonymous+Brave+Guy · · Score: 2
      I must be dense, but I don't have a clue how C++ templates are related to generic methods, or to multi-dispatch. C++ templates are truly hideous, but the ideas inherited by most "generics" implementions in Java compilers I've looked at haven't looked too bad.

      Erm... OK, I'll certainly agree that C++'s templates have a nasty, kludgy syntax. But surely the basic idea of having parameterised functions and types is about as basic in the generic programming spectrum as you can get? Whether the parameters are specified implicitly or explicitly, the underlying model is much the same. And the bits that Java borrows in its new spec are a sadly restricted subset of the same model. I don't see how you can object to C++ templates and advocate Java generics in the same sentence...

      But yes, I think we've both been trolled; I was thinking the exact same thing about closures as I read the parent post. :o)

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    40. Re:The "most controversial" proposal by eddeye · · Score: 1

      I'm surprised that [generics] didn't come into this top ten; it's a major language deficiency.

      Indeed, the same can be said for operator overloading. What's clearer for a numeric type,

      a.add(b).multiply(c.add(d))

      or

      (a + b) * (c + d)?

      The typical Java arguments against operator overloading smack of paternalism. "Overloading is bad, it leads to bad code. Trust us, we know what's good for you." You don't outlaw rope just people can hang themselves with it. You teach them how to use it properly.

      --
      Democracy is two wolves and a sheep voting on lunch.
    41. Re:The "most controversial" proposal by Anonymous+Brave+Guy · · Score: 2
      I've used C, C++, Assembler, Prolog, Scheme, LISP, Ada, SML/NJ, OCaml, Fortran, Cobol, Pascal, BASIC, Java, Perl, Python, Ruby, Eiffel, Erlang, Forth and far more languages that I can't pull off the top of my head.

      Fair enough. I guess the question is really how deeply you've used them. I'm not much older than you, and I too am enthusiastic and a fast learner, yet in spite of my formal background in CS and a few years working as a professional developer, I'd only really claim to know half a dozen languages in any depth. I may have experienced the basics of SML/NJ, OCaml, Perl, Python, LOGO, Scheme, FORTRAN, Java, BASIC in several forms, C, C++, Eiffel, x86 assembler, HTML, CSS, XThings, (La)TeX, METAFONT, MS batch files, JavaScript, and probably a few more if I think for another minute, but I don't truly understand more than a few of them.

      With no insult intended, I would submit that while your experience is broad, it probably is not yet deep (e.g., your comment about RTTI in C++ seems to be incorrect). That, and a general lack of exposure to the industry and the different spins people put on things depending on their background, would probably account for much of this thread.

      BTW, I always liked the terms "object-based" for a programming style where you have types that combine state and behaviour, and "object-oriented" for a programming style that makes use of polymorphism, encapsulation, etc. I don't believe there is any such thing as an OO language; there are just languages that support either or both of the above styles.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    42. Re:The "most controversial" proposal by Ayende+Rahien · · Score: 2

      > Lord God NO! Don't you EVER use C++ templates as an example of generics again. C++ templates are an attrocity. What you want is generic methods with multiple-dispatch. Look at Lisp's CLOS, or Dylan.

      How about Ada's Dynamic Dispatch method?

      > How can you write a Non-OO program in a Pure-OO language?

      Pretty easily, there are some FORTRAN programs out there written in LISP, you know.

      --

      --
      Two witches watched two watches.
      Which witch watched which watch?
    43. Re:The "most controversial" proposal by Ayende+Rahien · · Score: 2

      class Blat
      {
      static int a;
      static float b;

      public static void main(int argc, string[] argv)
      {
      a = 5;
      b = a * 2.5;
      foo();
      bar();
      return a;
      }

      private static void foo()
      {
      }

      private static void bar()
      {
      }

      }

      Are you willing to be on it? Here is a program that might as well be taken from plain C code.
      It's got global variables, too, just for spite.

      --

      --
      Two witches watched two watches.
      Which witch watched which watch?
    44. Re:The "most controversial" proposal by mlilback · · Score: 1

      > What you really need is generics (as in C++
      > templates). Java collections are vile, since they suffer
      > from type loss even when used with "real" objects.

      Huh? That's crazy. You never lose type information in Java. Just call .class() on the object and you'll know what type it is. C++ is where you lose type information, since it is a statically typed-language.

      Templates are vile and unnecessary in a dynamic (i.e. elegant) programming language--I should be able to add any kind of object I want to a container without having to know what class it is. And when I pull it out of the container, I should be able to find out what class it is. Since this can't be done in C++, templates were invented as a hack.

      After using a dynamic language, I would never go back to a statically-typed language (though Objective-C does this much better than Java).

      I'd really like to see Java adopt the Objective-C construct of not considering it an error to call a method on a null object. Code is much easier to read and works much better when you don't have to make null checks all over the place.

      I just learned Objective-C earlier this year and have been using Java since 1.0 came out. But from what I've done so far, I'd much rather use the Objective-C language over Java (but not necessarily the frameworks/class libraries). I'm in the process of junking all my C++ code to be Objective-C or Java instead.

    45. Re:The "most controversial" proposal by jtdubs · · Score: 2

      Fair enough.

      Like you, I only know around a dozen of the 30 languages I've used in any depth. Some of those dozen are functional, others procedural.

      My comments about RTTI in C++ are NOT wrong, however. C++ does not have run-time type checking of arguments to functions. It has inheritance, and with it virtual functions. This means that if you have a class and a subclass, and instances of each, that even if you cast the subclass to be a pointer to the superclass, if you try and call one of it's methods it will still call the one of the subclass, assuming it's virtual.

      In other words:

      class Super {
      public:
      void foo() { printf("Super::foo()"); }
      };

      class Sub : public Super {
      public:
      void foo() { printf("Sub::foo()"); }
      };

      int main(int argc, char** argv) {
      Super* s1 = new Super();
      Super* s2 = new Sub();
      s1->foo();
      s2->foo();
      delete s1;
      delete s2;
      }

      This code will produce the following:
      Super::foo()
      Sub::foo()

      So, theres polymorphism. Now, what about RTTI of arguments to functions. Known as multiple-dispatch. Unfortunately, C++ only implements single-dispatch, which means choosing the appropriate method based on the type of the object via which the method is being called. So:

      class Super {
      public:
      void foo() { printf("Super::foo()"); }
      };

      class Sub : public Super {
      public:
      void foo() { printf("Sub::foo()"); }
      };

      void Receiver(Super *super) {
      printf("Receiver(Super)");
      super->foo();
      }

      void Receiver(Sub *sub) {
      printf("Receiver(Sub)");
      sub->foo();
      }

      int main(int argc, char **argv) {
      Super *s1 = new Super();
      Super *s2 = new Sub();
      Receiver(s1);
      Receiver(s2);
      delete s1;
      delete s2;
      }

      This will produce the following output:

      Receiver(Super)
      Super::foo()
      Receiver(Super)
      Sub::foo()

      See the problem? That's due to C++ single-dispatch nature.

      Justin Dubs

    46. Re:The "most controversial" proposal by Anonymous+Brave+Guy · · Score: 2

      I think we have the same problem again. :-)

      To me, what you are describing is more than RTTI, it is multiple dynamic dispatch (which, it is certainly true, is missing from C++). RTTI, OTOH, is simply things like typeid or dynamic_cast, which allow you to determine, at run-time, the type of object that you've been passed. These could actually be used to implement a solution to your multiple dispatch problem under some circumstances, though it's certainly not as tidy as it would be in a language with native support for the feature.

      #include <iostream>
      using namespace std;

      class Base
      {
      public:
      virtual void Speak() { cout << "Base speaks" << endl; }
      };

      class Derived : public Base
      {
      public:
      virtual void Speak() { cout << "Derived speaks" << endl; }
      };

      void Speak(Base* pb)
      {
      if (Derived* pd = dynamic_cast<Derived*>(pb)) {
      cout << "A Derived object will now speak:" << endl;
      pd->Speak();
      } else {
      cout << "A Base object will now speak:" << endl;
      pb->Speak();
      }
      }

      int main()
      {
      Base b;
      Derived d;
      Speak(&b);
      Speak(&d);
      return 0;
      }

      (Darn, I hate /.'s limited formatting sometimes...)

      To me, this example is all that is implied by RTTI, and it's obviously possible in C++. As ever with the language, if you want to build more power on top of it, the tools are there but the extra power isn't provided as standard.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    47. Re:The "most controversial" proposal by J.+Random+Software · · Score: 1

      I don't want to sift random cruft out of a collection. I want to declare the type of the contents and eliminate type errors at compile time. That's what statically-typed languages are for. There are plenty of functional and prototype-based languages (many targeting JVM bytecode) I'd use if I wanted type checks postponed for runtime.

    48. Re:The "most controversial" proposal by bellings · · Score: 0, Troll

      You're correct, of course. I was overreacting in my post. C++ templates are one way to do generic programming. The guy managed to string a bunch of loosely related buzzwords together in a nonsense paragraph -- CLOS, Dylan, multi-dispatch, generic functions, templates, generic programming, and C++. I gladly took his bait, picked a few of the charged up words he so kindly provided, and started frothing at the mouth.

      I could talk for rant for days and days about generic programming. Heck, I could rant for days about just about any of the topics JTDUBS has provided for us. I wouldn't make any sense during any of the rantings, especially when constrained to the limitations of a forum like slashdot. I'm pretty sure that's exactly what JTDUBS had in mind, too. Either that, or he really is a clueless wank. With the best-crafted trolls, it's almost impossible to tell the difference.

      --
      Slashdot is jumping the shark. I'm just driving the boat.
    49. Re:The "most controversial" proposal by jtdubs · · Score: 2

      Ah, right, I see what you mean.

      I am unaware of the formal definition of RTTI, so you may very well be correct.

      If by RTTI you mean the ability to manually determine the type of a pointer via typeid and the ability to do dynamic_cast then, yes, obviously C++ would support RTTI.

      What I was referring to would be more accurately described by two terms. First off, dynamic vs static typing. C++ is obviously static. There aren't that many problems with this, but there are many useful things that can only be easily done with dynamic typing. Secondly, as my example demonstrated, single vs multiple dispatch. Where C++ chose single and CLOS uses multiple-dynamic.

      Anyway, yeah, this is probably another terminology thing. Being completely self taught there are a fair number of industry standard terms whos concepts I am familiar with but names I am not. This is one of those cases.

      Thanks for clearing that one up,

      Justin Dubs

  16. not if he wants everything to be an object by Anonymous Coward · · Score: 0

    haveing to do

    new int

    or the equivlent in the JVM would slow things down I am sure

    regards

    john jones

    1. Re:not if he wants everything to be an object by 91degrees · · Score: 1

      I think there are probably ways around that. new int will probably just allocate space on the stack if int is local anyway. The compiler can deal with whether or not to do that.

      Really there's no overwhelming reason the primitives can't remain as built-ins. They just need to behave in the same way as objects.

    2. Re:not if he wants everything to be an object by sbrown123 · · Score: 2, Insightful

      >>Really there's no overwhelming reason the primitives can't remain as built-ins. They just need to behave in the same way as objects.

      What do you mean in they have to behave like objects? So do they become garbage collected like regular objects? Can I serialize them? How about extend them? How does the equals() work?

    3. Re:not if he wants everything to be an object by Jhan · · Score: 1

      Steal 'boxing' from C-flat. The idea is that whenever a primitive is used as an object, it will be converted to it's corresponding object wrapper. Whenever a wrapper is used as a primitive, it will be converted back.

      In other words,

      5.toString();
      myList.add(3.14);
      will work, and will really do something like
      new Integer(5).toString()
      myList.add(new Float(3.14))
      theList.getElement(7)+4711;
      becomes
      ((Integer)theList.getElement(7)).intValue+4711;
      (Assuming element 7 was an Integer).

      In practice, there will probably not be any real wrapper classes. That will all be taken care of by hacks and patches in the VM, and the ints will always be 32 bits of pure integer goodness (in the interest of speed). The important thing is that the primitives will act like objects, where apropriate. This requires that the Integer etc. classes are final. OK by me. His idea that primitives should be replaced real, honest-to-god, subclassable, imutable objects almost made me lose my lunch. 7 years of hardware progress have made Java just barely useable for real applications, and he wants to throw it all away and put us in Smalltalk hell?

      --

      I choose to remain celibate, like my father and his father before him.

    4. Re:not if he wants everything to be an object by sbrown123 · · Score: 1

      >>Steal 'boxing' from C-flat.

      I like the idea but I have always seen issues with implementation. Using your example of boxing how would you convert a float of 5.5 to a String? The String class already has some static methods that can do what you described:

      String.valueOf(5.5f);

      What would be nice is String having instance methods to get primitive values:

      mystring.intValue();

      I am no guru on C# and have not read that much into boxing.

      As for the second part of your example you used the Collections API. I had this discussion on another thread that there are reasons you should use a primitive array over a Collections API when dealing with Java primitives: 1) Speed and 2) small memory footprint, 3) quick casting and copying. If you absolutely have to use a Collection just use the existing Number wrapper classes. But this should rarely arise (or atleast I can think of no good reason for doing this).

      >>imutable objects almost made me lose my lunch.

      Yeah, I ate light today. The talk about 4 byte charater Strings about made me sick. There is already String, StringBuffer, CharBuffer, and a CharSequence interface. I would love to see String represent old-school UTF-8 characters. Make another object that inherits from String that handles Unicode characters (UnicodeString). Put StringBuffer and CharBuffer functionality into String. Doing this you can drop CharSequence. The primitive type "char" would have to become 4 byte.

    5. Re:not if he wants everything to be an object by avante · · Score: 1

      Look more carefully at the article. I thought that too at first, but he talks about langauges where they did that and were able to internally hybridize the issue. If they could make it efficient enough, I would be completly behind it. Otherwise, I agree. Also, you would not need to use the "new" operator. It would essentially be done like this: Integer i = 20; That 20 could be an internalized "static" value. Of course, with large numerical data-sets, it's not clear how that can be properly optimized.

    6. Re:not if he wants everything to be an object by Ayende+Rahien · · Score: 2

      Floats are easy.
      You can only have one period in a floating point number, so you consider every number with a period in it as a double, and treats the second period as a serperator.
      The following compiles perfectly on C#:
      5.5f.ToString();//Float to string
      5.5.ToString();//Doublt to string

      As for the reverse, it's not String's place to have convertors in its interfaces.
      Each and every type should supply its own.
      On C#, it's as easy as:
      int a = Int.Parse(some_string);

      --

      --
      Two witches watched two watches.
      Which witch watched which watch?
    7. Re:not if he wants everything to be an object by sbrown123 · · Score: 1

      >>The following compiles perfectly on C#:
      5.5f.ToString();//Float to string
      5.5.ToString();//Doublt to string

      In Java that simply looks like this:
      String.valueOf(5.5f);
      String.valueOf(5.5);

      >>it's not String's place to have convertors in its interfaces.

      What interfaces? String already has valueOf() functions for all primitive types. Adding the capability to get values out of Strings would be a nice feature.

      >>On C#, it's as easy as:
      int a = Int.Parse(some_string);

      In Java its pretty easy too:
      int a = new Integer(some_string).intValue();

      If my String idea was used you could write it:

      int a = some_string.intValue();

    8. Re:not if he wants everything to be an object by miniver · · Score: 2
      >>On C#, it's as easy as:
      int a = Int.Parse(some_string);

      In Java its pretty easy too:
      int a = new Integer(some_string).intValue();

      Under Java it's even easier that that:

      int a = Integer.parseInt( some_string );

      Just remember to catch the NumberFormatException.

      FWIW, String isn't the right place to do data conversion -- you'll have to change the String class everytime you want to add another data conversion for another type. Java already does this the way it should (and so does C#). Sure, the code isn't as 'pretty' that way, but you keep the information where it's supposed to be: with the data class, not with a representational storage class.

      --
      We call it art because we have names for the things we understand.
    9. Re:not if he wants everything to be an object by sbrown123 · · Score: 1

      >>Under Java it's even easier that that:

      Not easier but rather just another way to do make the same Mouse trap. If we go by code size as being "easier" using parseInt requires a try/catch block being implemented since it throws a NumberFormatException. Both are used in different situations.

      >> you want to add another data conversion for another type.

      There are only 8 primitive data types: boolean, char, byte, short, int, long, float, and double. I know of no reason why that would ever change.

      >>but you keep the information where it's supposed to be: with the data class, not with a representational storage class.

      I do not understand your terminology. Please give a definition of what you call "data" classes and "storage" classes.

    10. Re:not if he wants everything to be an object by miniver · · Score: 2
      Not easier but rather just another way to do make the same Mouse trap. If we go by code size as being "easier" using parseInt requires a try/catch block being implemented since it throws a NumberFormatException. Both are used in different situations.

      The difference is this: do you want to create an object and throw it away, or not? Your way creates a new object and then immediately throws it away; my way doesn't. That's a pretty expensive operation ... much more expensive than try/catch. If you want to parse numbers from strings without having to worry about catching exceptions, write a static method in a utility class.

      >>but you keep the information where it's supposed to be: with the data class, not with a representational storage class.

      I do not understand your terminology. Please give a definition of what you call "data" classes and "storage" classes.

      String has been overloaded as a class: it serves two purposes. The first is to store strings, and the second is to store string representations of other types of data (numbers, XML, whatever). When used in the first sense, it's a data class; when used in the second sense it's a representational storage class - it's storing a representation of the data, not a directly useable instance of the data. It's the difference between 5+4 (9) and "5" + "5" (55).

      My point was that the String class should know how to manipulate strings, but it shouldn't know about manipulating numbers stored in string format.

      --
      We call it art because we have names for the things we understand.
    11. Re:not if he wants everything to be an object by sbrown123 · · Score: 1

      >>way creates a new object and then immediately throws it away; my way doesn't.

      A java String instance is created whenever the java compiler encounters a string in double quotes. See the definition of String in O'Reilly's "Java In A Nutshell". That means in your example a new String was created and passed to parseInt. So no, you did not create a better Mouse Trap.

      >>String has been overloaded as a class: it serves two purposes. The first is to store strings, and the second is to store string representations of other types of data (numbers, XML, whatever).

      Oh lordy! First, there is no overloading in Java. Second, String is a class. It is used to either contain an array of unicode characters or operate on them. Thats it. There is no storage of XML or numbers or whatever. Just unicode characters.

      >>it's storing a representation of the data, not a directly useable instance of the data. It's the difference between 5+4 (9) and "5" + "5" (55).

      I dont know what this has to do with the price of cheese. Seriously, I am having troubles understanding your point.

      >>but it shouldn't know about manipulating numbers stored in string format.

      This is if you view parsing a number out of a string as manipulation.

    12. Re:not if he wants everything to be an object by sbrown123 · · Score: 1

      You made some good points. I hate dragging threads out and will not be posting anymore.

    13. Re:not if he wants everything to be an object by Ayende+Rahien · · Score: 2

      > String.valueOf(5.5f);
      >What interfaces? String already has valueOf() functions for all primitive types.

      That is bad coding practice. It's nice and easy, but it's not good to do so.
      The reasoning? Simple.
      Why you have String.valueOf(Int) and not String.valueOf(SomeCustomClass) ?
      Using this method puts the responability for translating the object to string representation in the hands of the String class. It should be the responsability of the objects to supply it.
      String.valueOf() shouldn't exist.
      Or should exist in this form:
      string string.valueOf(object Obj)
      {
      return Obj.ToString();
      }
      The above won't work on Java, because of the primitive system it uses, but it would work just fine on .NET/C#.
      You are going to argue that this is (probably) possible in Java, with one method for object, and overloads for all the primitive types.
      The problem here is when you want to add a new primitive type, say Complex.
      You *can't* do that without adding a new method to String, and to any other class that wants to be able to handle all types in Java.

      > If my String idea was used you could write it:
      > int a = some_string.intValue();

      This is even worse, mind you.
      There is no justification for such an abomination in the interface.
      This has *no* place here, it should be, as it is, in the Integer class.

      --

      --
      Two witches watched two watches.
      Which witch watched which watch?
  17. O'Reilly says? by joshua404 · · Score: 0

    What the hell does that guy even know about coding? I bet he hasn't done any programming since he left Hard Copy for Fox.. oh.

  18. The only problem with Java by jukal · · Score: 1, Flamebait

    ...is to know what to use to make it work on all of your target platforms...and wasn't this supposed to be one of Java's strong points? So, actually, a fresh start might not be that bad at all.

    1. Re:The only problem with Java by Anonymous Coward · · Score: 0

      > (Score:1, Flamebait)

      Hardly 'flamebait'. WriteOnceRunAnywhere was (and is) one of the claims for Java's superiority as a design choice. It has proven to be not quite a straightforward a solution as that nice soundbite.

  19. Another name for this article: by Anonymous Coward · · Score: 0

    "Top ten reasons to use C# and not java" - This is great ammo!! Thanks Slashdot!

  20. The Mac OS X JVM has this already by d3xt3r · · Score: 5, Insightful

    it also means each process has the initial overhead of starting the VM and the continuing overhead of the same duplicated code running in memory for each VM.

    Startup time is not only an actual problem, but its gives a very bad impression when just launching a program takes a while.

    Apple's JVM implementation for OS X already supports some of the features which you are requesting... For instance, Apple's JVM uses a shared memory space between JVM instances. This significantly reduces the memory footprint of each JVM instance and allows classes to be loaded only once. Example: I launch 2 Swing apps, they can share the same JFC classes, requiring class loading only once. I can stop and start the one of the appilcations without having to wait for Swing to be reloaded into memory.

    Additionally, startup time is really not an issue on OS X. I am writing a fairly complex Java Swing application right now. On start up, it parses 3 (one of which is very large) configuration files, it creates a few Swing components, and finally displays a complex JFrame to the user. Total time for a cold start (no other JVM loaded) is approximately 2 seconds. That's certainly not slow. Not Sun needs to take a look at what Apple did and implement it back across their JVM implementations.

    One big thing Java needs is a multi-process VM.

    I don't really see what the advantage of this is. Again, the JVMs from Sun and Apple both use native threads. On most platforms, thread creation is less expensive than process creating. This is why Apache 2.0 is a hybird muli-threaded/multi-process application. Apache used to run a multi-process only model and it bogged down on Solaris b/c of process creation overhead. The new model overcomes this by using threads more heavily. As long as the threads take advantage of native thread features, like _____, thread use is most likely more efficient than process use.

    BTW, on Linux, there is no real difference between a process and a thread, so Sun's JVM is already "multi-process" on Linux. And it's not any faster than their other implementations. As a matter of fact, Apple's JVM blows away Suns implementation on Linux and Windows (I haven't been able to test against Solaris).

    1. Re:The Mac OS X JVM has this already by Mr.+Quick · · Score: 2

      d3xt3r,

      where did you get this info? i'm not second-guessing you, i just want to read it. can you point me to these docs, or is this something that you've learned through development.

      thanks,
      tyler

    2. Re:The Mac OS X JVM has this already by d3xt3r · · Score: 2
      Well, you can start with Apple's Java page. You'll have to poke around a bit, but they have info on their JVM implementation there.

      I also have read about their JVM implementation at O'Reilly's web site (sorry, don't have any links but I'll see if I can find you some).

    3. Re:The Mac OS X JVM has this already by Mr.+Quick · · Score: 2

      perfect, that's great.

      i assumed that apple's dev site was the main jumping off point, i obviously just haven't looked around enough.

      thanks.

    4. Re:The Mac OS X JVM has this already by CynicTheHedgehog · · Score: 2

      It's been my experience that Swing applications run immeasurably faster using the Windows JVM. SunONE Studio CE and LimeWire respond quickly, don't flicker, and in general behave like native applications. The same cannot be said with Linux, sadly. Poking around on my iBook I noticed a whole lot of JNI stuff in the Java library paths...looks like a bunch of hooks into the user interface and operating system. I'll have to explore that more, but it looks pretty exciting.

      But back on topic, breaking Java1 and Java2 compatibility is absolutely asinine. That would contradict one of the core design principles. Apple's got a decent JVM, apparently; the Windows one ain't bad; and IBM's developing a clustering VM that yields an 80% performance boost (or some ridiculous number like that).

      The big thing I'm noticing is that Sun's implementation is somewhat lacking. What we need is a faster, more efficient VM. We have the specs, so that shouldn't be a problem. Or at least Apple and IBM don't seem to think so.

    5. Re:The Mac OS X JVM has this already by Anonymous Coward · · Score: 0

      You've answered your own question. Ignore Mac OS X for now... on Linux and on Windows, when you run Java, a new process is created. Native components at least share memory automatically through the OS, but all of the Java classes are data: they must be individually mapped into memory, parsed, and optionally turned into native code by the JIT. By making a single process share memory, you only need to JIT shared code once.

      The downside is that you limit the amount of memory your application can use (most likely not a problem), the number of threads (possibly a problem if you can't use asynch I/O in your server app), the number of open files (possibly a problem if you're on a Unix system and you've forgotten to raise your limits), and CPU (if your scheduler adjusts your thread priority based on the overall process system usage)

    6. Re:The Mac OS X JVM has this already by d3xt3r · · Score: 2

      I rememebered the other place I saw some great info on Apple's Java implementation was Java Developer's Journal March 2002 issue. They have a 10 page spread discussing Java on OS X.

    7. Re:The Mac OS X JVM has this already by maraist · · Score: 4, Informative

      BTW, on Linux, there is no real difference between a process and a thread, so Sun's JVM is already "multi-process" on Linux.

      You confuse me, because you obviously must understand the difference between threaded and multi-processed, yet you claim that there's no difference in Linux. There are numerous functional differences between the two. First and foremost, you have 100% isolation (sand-boxing). You're not concerned with race-conditions (well, you have to go out of your way to produce them at least), you have to explicitly share material (e.g. pipes or magical fork-aware objects), you're crash-proof (apache has a master process image; if one worker "thread" dies for almost any reason (baring OS problems), it VERY quickly forks a new worker which is 100% ready to go), and finally, MP has better caching issues with multiple CPUs (e.g. no shared and slow writable cache). To boot, while MT saves more total memory, MP more efficiently distributes it to workers. Non modified memory is freely shared in a safe manner (marked as read-only by the OS, and thereby efficiently cached by each CPU), and only modified memory gets moved. Granted, in JVM's garbage collector, the entire heap is constantly remodified.

      As other's have said, I support the general idea of Apple method of sharing memory space between JVM's; though I don't know it's particulars. Most notably, the shared memory should be read-only (to avoid interdependency crashes). Next, it should only be shared per user (or at least copy-on-write), to disallow viral infections.

      My concern is obviously for that of robustness. Java is already flimsy as it is in this respect (imagine running an entire OS with a single such point of failure).

      --
      -Michael
    8. Re:The Mac OS X JVM has this already by d3xt3r · · Score: 2

      Most kernels differentiate between processes and treads, however, the Linux kernel does not. In most OSes process context switches are slow, while thread context switches are fast. However, in Linux, process switches are fast. In Linux a process simply represents a schedulable entity. The scheduler does not care about the process or thread's shared resources. A linux processes has full control over its resources and child processes.

    9. Re:The Mac OS X JVM has this already by egomaniac · · Score: 5, Insightful

      My concern is obviously for that of robustness. Java is already flimsy as it is in this respect (imagine running an entire OS with a single such point of failure).

      "Flimsy"? I've been a professional Java developer for six years. I have written server software (running to Solaris and Linux) and client software (Swing applications running on Windows, Macintosh, and Linux). The server-side software is used by almost a million people a day; the client-side software hasn't yet been released to the public but is already being used internally. It will be used by millions when it is released.

      Number of Java crashes I have seen in the past few years: Zero.

      Java is obviously only as stable as your computer, so of course when a whole Windows machine goes down, you lose Java as well. However, I have seen absolutely no crashes directly tied to Java, on any OS, since JDK 1.2.2 came out. I don't know what version of Java you are playing with, but I'd hardly call that "flimsy".

      As far as "imagine running an entire OS with a single such point of failure", that is perhaps the most ridiculous thing I've ever heard. Are you suggesting the Linux kernel is not a single point of failure? When the Linux kernel freaks out, your whole system goes down. That's a single point of failure if I've ever heard one.

      --
      ZFS: because love is never having to say fsck
    10. Re:The Mac OS X JVM has this already by Jord · · Score: 1
      The flickering you are seeing on your windows box is due (this is claimed, not my opinion) from the Windows JVM being able to access parts of the GUI code that Sun's JVM does not or cannot.

      I have noticed, however, that Sun's JVM runs great on every other operating system other than windows. Having said that, non-GUI apps run as well as expected on Windows and run MUCH faster with Sun's JVM as opposed to MS's JVM. I suggest you grab Java 1.4 and give it a try. Much faster than MS's ancient outdated JVM. Not to mention that the GUI access has been drastically improved in 1.4

    11. Re:The Mac OS X JVM has this already by maraist · · Score: 2

      "Flimsy"? I've been a professional Java developer for six years. I have written server software (running to Solaris and Linux) and client software (Swing applications running on Windows, Macintosh, and Linux)....

      Number of Java crashes I have seen in the past few years: Zero.

      Swing was horrendously buggy initially. In fact, we found many a case where the old java 1.1 cored on solaris (with and without swing; though swing had a much greater propensity to crash or hang). None of the companies I've worked with has dared use swing in production code, so I don't know how good it is these days.

      As for robustness, I'd like to point out that core dumping isn't the only metric. Java uses more memory than any other language I've seen used at the enterprise level. (I'm sure there are worse, but I've not enountered them). Using any sort of swap with java is insane, because of it's garbage collection model (In my opinion, a mixed blessing at best). I've actually written several garbage collectors and memory managers, and my opionion is that any such mark/sweet or collector is not suitable for arbitrarily large enterprise apps. Once you can get your app into a state where it's out of main memory, you're thrashing to the hard drive on every gc. Heaven forbid your app actually requires more memory than you have physical by itself. It's bad enough when you have two competing java apps fighting for memory.

      Personally, I prefer ref-counting, which adds run-time performance overhead, but avoids the swap-thrashing issue for heavy-loads. I know that java is capable of utilizing any garbage collection scheme it chooses, but the defaults are never ref-counting; even on such hungry apps.

      The main reason I dislike non-ref-counted garbage collection is that a simple loop which allocates and throws away strings produces hundreds of thousands of memory allocations under many systems (such as in many jdbc drivers). These simple small and allocations would be trivial to maintain under ref-counting.

      Sorry for ranting, but I just so happen to be plagued with these issues (a servlet engine idling at 298Meg even with different VM's and settings).

      Further on the stability issue. Not allowing static linking, and allowing new versions of classes to sneak in and thereby cause crashes is a common occurance with that java-model.

      Java is obviously only as stable as your computer,

      So is visual basic, but I think make such a statement about VB is misleading, since even syntax errors can lay dormant in VB waiting for just the right section of code to be accessed; crashing your app. I definately believe java to be a robust "syntactic language", but the underlying platform is still very sensative to design and maintanance mishaps.

      There is a large amount of indeterminism associated with Java.. When will it garbage collect, when will file handles be closed, how much memory is it going to need, etc. These things make it harder to design robust enterprise systems (though not impossible). These are the sorts of gotcha's that reduce Java' stability in my opinion. Yes you can design bad c-code, but it's almost impossible to attain determinism with java in some areas.

      As far as "imagine running an entire OS with a single such point of failure", that is perhaps the most ridiculous thing I've ever heard. Are you suggesting the Linux kernel is not a single point of failure?

      There is a javaOS, by the way. A hardware product an old company of mine created used it. And I'm not suggesting that linux isn't a single point of failure.. I AM suggesting that the platform the linux kernel was developed on is more inherently stable than java. The key word was "such", which meant my so called "flimsy" java being the weakest link and also being a single point of failure for everything. Thus the most stable you can get a javaOS pales in comparison to the most you can get with c. Granted, an initial build of a javaOS is probably going to be more stable than that of c due to java's inherent type-safety.

      Java is getting better; yes. And VM writers are free to develop better memory managers. But it's still bleeding edge in my opinion. I wouldn't consider java as having 4 nines availability; especially if the latest features in each release are being utilized. What's worse, the fact that most old features keep getting deprecated, it's nearly impossible to maintain a properly robust API (e.g. to say, yes, java.io is finally robust since it's had 2 major versions behind it).

      --
      -Michael
    12. Re:The Mac OS X JVM has this already by Anonymous Coward · · Score: 0
      No, the Mac OS X JVM does not have "this." Apple Zealot Alarm. All Points Bulletin.

      You stupid zealot man-bitch. The only reason I might halfway believe your lying bullshit zealot plug for OS -SHIT X is that Motorola PPCs are so fucking slow they need a custom JVM. I would buy OS X to support Unix on the desktop, but dipshit Apple is still fucking off with gay lame shit mongoloid-tard PPCs. And fuck Altivec, you fucking zealots - check out the SPEC CPU2000 int and fp for the MOT-G4 - oh, wait, pussy Apple wont even publish them! HAHAHA. I have a G4. It was given to me for free. I gave it back to the owner because it sucked. Apple's stupid shit user base is still 80% on native classic. OS 9,8,7 whatever you want to call it is such fucking shit it bends the fabric of space and time. Apple's Xserve is a piece of shit, half the speed of a P4, twice the price, no ECC or SCSI. Dell 1650 and 2650 blow the doors of that shit. Even a P3-1400/512 beats a G4-1000. Look it up slut. Its in the SPEC marks, its on Digital Video Editing's site. Like Adobe says, Evidence that APPLE sucks balls is "everywhere you look."
      These are the best CINT2000-base and CFP2000-base results for various CPUs.

      Athlon XP 1800MHz ("2200+") : 738 / 624

      Pentium4 2533 MHz : 893 / 878

      Power4 1300 MHz : 804 / 1202

      Itanium2 1000 MHz : 807 / 1356

      G4-1000MHz 306/187
      And here it is, the Apple's losing HORRIBLY to the PC in benchmarks where AltiVec is supposed to save the day

      And here we go again, a fucking Dual MAC G4-1000 getting its fucking ass kicked hard by a single Dell P4 2.5GHz. Where your Altivec now, fuckheads?

      An easy way to see if people say the truth or not when they speak about the respective speeds of their CPUs. I like to see what people say, and compare that to SPECCPU2000 results. The differences are sometimes very surprising. Well, are they so surprising? Let's have a look at the 3 major "vendors" of CPUs systems, Intel, AMD and... Apple (because Motorola doesn't seem to gloat about the performance on the PowerPC G4, only Apple does).

      AMD has recently released their new Athlon XP 2200+. Is it really faster than a 2200 MHz CPU? On integer stuff, the AthlonXP is good for 738 points. The funny thing is, a Pentium4 at a mere 2GHz scores the same 738 points. Oh, yes, I know, that's because AMD has a superior floating-point performance. Sure. CFP2000, AthlonXP goes as high as 624 points. And the poor little Pentium4 at 2GHz with its slow FPU only gets 744 points. Please read that again. So, how much floating-point power is there in an Athlon XP 2200+ running at 1800 MHz? Well, about as much as in a Pentium4 running at 1600MHz. Man I wouldn't want to have just read that if I was an AMD zealot, that's gotta hurt.

      Don't worry, my AMD friend, your CPU performs more than adequately. Wait until I talk about the "super-computer" G4 that is used by Apple.

      G4 1000MHz: 306 points in integer. Just like a PIII at 667MHz. But, as you all know, The G4 is extremely good in floating point, capable of doing billion operations per second. G4 1000 MHz: 187 point in floating point. That's the level of a PIII at 500MHz. Oh my God, if I overclock three-year-old my dual-PIII from 450 to 504 MHz (where it is perfectly stable), I get as much FPU power as a top-of-the-line Mac. I don't know if I should laugh or cry. I just feel sad for all the people who fall in for Apple's propaganda. If a Mac can do all that a "Wintel" PC can do (yeah, right), well, it'll be doing it much much much much slower.

      A few comments before people flame me. Or maybe a few comments that'll cause people to flame me...

      I picked the baseline results over the peak results. Because I only had baseline results for the G4, and because I think that they are more realistic to show real-world speed: if you're a developer, just use the same compiler flags as Intel, Dell or AMD used, they are published in the benchmark report.

      The fact that the G4 benchmarks come from a magazine and are not official results. I would normally have put a disclaimer about that. Well, if you're not happy about the results, please go and put some pressure on Apple to publish official results. I monitor the SPEC results on a regular basis, and I'll be more than happy to take any official results into account.

      Some zealots will say that the G4 can do better than that because gcc doesn't use Altivec. Well, now, it's not my fault if you don't have a decent compiler, is it? Do you think that someone with a mind would go spend some time hand-optimizing his/her code in assembly for a CPU that only has a few percent of market share? Imagine a team of 30 engineers trying to release an application simultaneously for Windows and MacOS. 28 engineers write the portable core of the application (and they all develop on Windows with Visual C++ and Purify), 1 engineer is responsible for the Windows adaptation layer and Windows optimization (like, tweak the compile flags for the intel compiler), 1 engineer is responsible for the MacOS adaptation layer, MacOS-specific issues and MacOS optimization (like, deal with a compiler that doesn't support the Visual C++ extensions, deal with a CPU that orders bytes differently, deal with an OS that'll do some things differently, like not have drive letters, use slashes instead of backslashes as a file separator, not support MDI, put the menubar at that top of the screen, and when there's a little bit of time left, re-write in assembly a routine that the original programmer will modify so much before the release date that it'll have to be re-written in assembly 5 times in the coming year). I wouldn't want to be the MacOS guy.

      Oh yeah, I've also read that running SPEC benchmarks for PowerPC was unfair because the benchmarks are x86-specific. Well, I guess that the same benchmarks are also unfair for HP-PA CPUs, Itaniums, Sparcs, MIPS, Alphas, POWER... which all manage to beat the G4. The only reason why they're "unfair" for PowerPC is that those benchmarks are written in C, C++ and Fortran, and that the measure as much the compiler as the CPU. Got a sucky compiler? You'll get bad SPEC results. Guess what? Got a sucky compiler? You'll get bad results on everything but the 3 routines that Apple will optimize by hand to make Altivec shine...

      So, I guess that the only CPUs worth considering are Intel's. The Pentium4 rocks (I'm dreaming of buying a dual-Xeon 2200 MHz, but I'm not sure I want to afford the $2000 that such a beast costs). Itanium looks very promising, especially with an incredible FPU power (if you want numbers, well, how about 645 points on last year's hardware?).



  21. Arse by yatest5 · · Score: 0, Flamebait

    10. Get rid of deprecated methods - don't be an arse, ruins past compatability with no benefits.
    9. . Fix incorrect naming conventions - Jesus, Get OVER it!
    8. Eliminate primitive data types - oh yeah, please let me do x = new Int(1) + new Int(3);
    7. Eliminate primitive data types - oh, ok then
    6.

    OK, bored now...

    but, really,

    No single topic is as confusing to new users as the class path. I get almost daily e-mail from novice readers asking me to explain the "Exception in thread 'main' java.lang.NoClassDefFoundError: HelloWorld" error messages they keep seeing.

    Well, tell them to get fucked and go and read the Java tutorial then! You don't even need classpath from Java 1.2 onwards. Jesus, let's redo a language because first-time users can't get Hello World to work!

    This is a really wank article - I like the conclusion..

    Java needs fixing, I really don't know how or why, so lets discuss it. Arse. and Arse again.

    --
    • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
    1. Re:Arse by Jugalator · · Score: 3, Funny

      Well, tell them to get fucked and go and read the Java tutorial then!

      Hey, it's hard to figure out the classpath! You need to take the dots and change them into slashes, for crying out loud! And never forget the classpath is relative to the base directory! my head hurts... *sob*

      --
      Beware: In C++, your friends can see your privates!
    2. Re:Arse by bje2 · · Score: 3, Insightful

      10. Get rid of deprecated methods - don't be an arse, ruins past compatability with no benefits.

      people shouldn't be using deprecated methods anyway...that's why they're deprecated, becuase they may not be supported in future releases...this makes perfect sense...

      Eliminate primitive data types - oh yeah, please let me do x = new Int(1) + new Int(3);

      did you even read his explanation??? from the article: "The new byte, int, long, double, float, and char classes would still have the literal forms they have today. Just as the statement String s ="Hello" creates a new String object, so too would int i = 23 create a new int object."...the way you use them wouldn't change at all...in fact this would totally eliminate the need to create new Integers, Doubles, Booleans, etc, when you wanted to put primitive things in lists, hashmaps, etc...that's a big pain now...

      --

      "Facts are meaningless. You could use facts to prove anything that's even remotely true." - Homer Simpson
    3. Re:Arse by BigTimOBrien · · Score: 1

      Agreed,

      Java needs a new I/O subsystem because it doesn't effectively support file copying and renaming. Why can't this guy start working on a FileUtils package in Jakarta or Tigris? Why does Sun have to be the originator of all Java functionality.

      Arse, arse, arse.

      --
      ------ Tim O'Brien
    4. Re:Arse by jbolden · · Score: 1

      Because Sun owns the language Sun controls the definition and Sun sets the standards. The same way any core functionality of Visual Basic has to come from Microsoft and any core functionality of Postscript has to come from Adobe.

    5. Re:Arse by Anonymous Coward · · Score: 0

      "Just as the statement String s ="Hello" creates a new String object"

      String s ="Hello" does NOT create a new String object, it creates a new reference to the string object in the string pool. Hence a class with the code:

      String s1 = new String("Hello");
      String s2 = new String("Hello");
      String s3 = new String("Hello");

      will create 4 strings. 1 when the class is loaded, and 3 at runtime, whereas the code

      String s1 = "hello";
      String s2 = "hello";
      String s3 = "hello";

      will only create 1 when the class is loaded, and create new references at runtime. Also in the first case s1!=s2!=s3, whereas s1==s2==s3 in the second.

  22. Isn't by yatest5 · · Score: 2, Interesting

    making improvements to Java, which make it incompatable with older JVM's, and simplifying and improving the GUI bit, exactly what MS did and got slated for?

    --
    • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
    1. Re:Isn't by tswinzig · · Score: 2

      The difference being we can definitely expect Java 3 to make it to platforms besides Windows.

      --

      "And like that ... he's gone."
    2. Re:Isn't by yatest5 · · Score: 2

      The difference being we can definitely expect Java 3 to make it to platforms besides Windows.


      I think the difference is we're not going to see a Java 3, or certainly not one that implements the changes set out in this document.

      --
      • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
    3. Re:Isn't by pmz · · Score: 1

      making improvements to Java, which make it incompatable with older JVM's, and simplifying and improving the GUI bit, exactly what MS did and got slated for?

      It doesn't matter what Microsoft tried to do or actually did, because once they make things to work only in their own sandbox, they lose all credibility.

      The one thing Microsoft should get credit for is perverting everything they touch. They deliberately try to break things in subtle ways to make themselves look favorable. Microsoft ranks among the dirtiest politicians in the world.

      This is why I cringe when I read someone defending Microsoft's actions. Odds are, they are defending the problem and not the solution.

  23. What a great article. by Shayde · · Score: 2, Insightful

    Its wonderful seeing well thought out postings on this topic - my respect for this guy has just gone up a LOT, and I'm going to take a look at his books.

    Talking about "what should be Java" and "what should not be Java" is a volatile topic no matter how you slice it. One thing I think the Java community has going for it is that they're not nearly as fragmented or hyper-screaming knee-jerk as a lot of the C or C++ community is.

    I could see Sun and/or the JCP taking these proposals and starting the J3 development cycle. The trick is that much of what he's talking about is more than just a couple weeks hacking by a few dozen coders. Theres some serious internal redesigns here. However, he has worked them all through, with well-thought out arguments for and against each of his points.

    I don't profess to be a Java guru. I've only been working in the language for about a year, but I've found it strong, the community intelligent and professional, and the environment a pleasure to work with.

    Java ain't just applets and painfully slow JVM's anymore.

    --
    Event Management Solutions : http://www.stonekeep.com/
    1. Re:What a great article. by NorthDude · · Score: 1

      Talking about "what should be Java" and "what should not be Java" is a volatile topic no matter how you slice it

      synchronized(topic){} problem solved :-)

      --


      I'd rather be sailing...
  24. Not much left... by Anonymous+Brave+Guy · · Score: 2

    I confess that I'm confused. You use words like "supremacy" when praising Java over C++, yet you think it's missing three of the big strengths of C++ that you would find useful. It also has no generic programming support to speak of, yet this is one of C++'s strongest features.

    That's covered what Java takes out of C++, though of course you're not obliged to use any of it in C++ either. Java then gives you some degree of portability, GC and a vast standard library, though each of these also obviously has bad points as well as good (write once, debug everywhere/lack of deterministic destruction/bloat and bad design in places).

    I can't really think of any other "big features" that distinguish programming one from programming the other in a really significant way. That being the case, I can't understand how you could describe either language as being better than the other; surely if you're after portability and safety for junior guys you'd err towards Java, while if you're after performance, low-level hacking or more powerful design tools you'd err towards C++?

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Not much left... by Anonymous Coward · · Score: 0

      I confess that I'm confused

      YHBT. YHL. HAND.

  25. true by Anonymous Coward · · Score: 0

    this comment says it all
    bluntly....

    I mean has this guy ever actually looked at the debugger and tried to optermize things ?

    new objects are a big penelty and this guy wants to make int into one ?

    mapping a stack based VM ontop of a register based machine is never going to be easy

    and ontop of that you cant get rid of AWT and expect SWING to work arrgghhh

    fools

  26. Base64 = Memory Waste by Anonymous Coward · · Score: 0

    I've actually tried to Base64 encode binary files in Java to make them safe to represent as strings and it ain't pretty memory-wise.

    This person has some good points too but I don't believe s/he knows the base64 point first-hand.

  27. Point by point by joe_fish · · Score: 4, Insightful

    10. Delete all deprecated methods, fields, classes, and interfaces

    They don't get in my way much, so removing them wouldnt help me at all. It would only force me to re-write old but working code. I disagree with this one.

    9. Fix incorrect naming conventions

    Is InetAddress really that confusing that I need to re-write everything? And where is the benefit to me in moving java.sql to javax.sql. None that I can see, and it will create more errors until I learn the new way. I disagree with this one too.

    8. Eliminate primitive data types

    I can see the benefit to this. I like C#'s compromise where it automatically casts from native type to Object. BUT I don't think it is a good idea to slow Java down. It already has a bad reputation for speed, lets not make things worse. And as for "The int/char/double/float/boolean objects would be immutable, so these objects would be thread-safe and could be interned to save memory" I don't think you've really though this through Eliotte. What about "i++"? So I disagree with this one too.

    7. Extend chars to four bytes

    May I dont spend enough time writing XML parsers, but I've never been bitten by this one. So to me it doesn't seem worth the cost of re-writing everything. So I disagree with this one too.

    6. Fix threads

    Yes Thread have had problems, but they are still very useful. I'm prepared to make use of Thread and wait for the JSR to come up with improvements. I am more in agreement here, but not to the point of shoulding applause

    5. Convert file formats to XML

    I can see the benefits, but not enough to re-write all my servlets etc. And I don't think this change requires Java 3, just some updates to the servlet spec etc. Reason for Java 3? Not from where I stand.

    4. Ditch the AWT

    I can hear people (IBM) wanting to drop Swing because it is too slow, but not so much wanting to drop AWT. The key thing is where does anyone benefit from removing AWT? Surely have a class call JButton is not that complex that we need to break all that code? I'm not agreeing with this one much either.

    3. Rationalize the collections

    Well there aren't that many problems. I suggest we just *gradually* deprecate Vector and Hashtable and carry on with the alternatives.

    2. Redesign I/O

    No not again! Please! I've taken 2 re-writes already. Perhaps File could be updated as some of Eliotte's suggestions, but that hardly requires Java3.

    1. Redesign class loading from scratch, this time with human interface factors in mind

    Accepted this is a problem. But while neither I nor Eliotte has a solution, perhaps we should make do with learning the idiosyncracies, or finding solutions rather than calling for Java 3.

    1. Re:Point by point by Anonymous Coward · · Score: 0
      And as for "The int/char/double/float/boolean objects would be immutable, so these objects would be thread-safe and could be interned to save memory" I don't think you've really though this through Eliotte. What about "i++"? So I disagree with this one too.

      What's wrong with i++? It's just shorthand for "i=i+1". "i+1" would be another (possibly) interned integer object, that is then stored in the variable "i". Everything works.

    2. Re:Point by point by Anonymous Coward · · Score: 0

      I can see the benefit to this. I like C#'s compromise where it automatically casts from native type to Object. BUT I don't think it is a good idea to slow Java down. It already has a bad reputation for speed, lets not make things worse. And as for "The int/char/double/float/boolean objects would be immutable, so these objects would be thread-safe and could be interned to save memory" I don't think you've really though this through Eliotte. What about "i++"? So I disagree with this one too.

      The underlying int object is, in fact, immutable. You have confused objects with variables. What he is saying is that even though "6" is an object, you can't do 6++ to it and make all "6" objects in the system be "7" objects. The increment operator simply makes the variable reference a different, but still immutable, int object.

      How much do you think this would slow Java down? How about you no one complains until they see some benchmarks?

    3. Re:Point by point by Fweeky · · Score: 2
      What's wrong with i++? It's just shorthand for "i=i+1"


      No, i++ is shorthand for "i.increment()". If you make ints etc immutable you can't do this, because it's like trying to write 1++, hence making all instances of 1 in the system into 2.

      It's no great loss imo; I thought I'd miss it in Ruby, but it turns out that i+=1 isn't much more to type and there's a lot to be said for having a nice clean object model.

      Of course from a backward compatibility standpoint it would suck somewhat. It'd have to be called Java++ or something ;)
    4. Re:Point by point by jiriki · · Score: 2, Insightful

      [Classloading]
      > Accepted this is a problem.
      Classloaders are a little difficult to understand, but they are not a problem!

      Classes loaded by different classloaders may never have the same type, because they might be completly different, implement different interfaces and have nothing at all to do with each other.

      Also you could load a class java.lang.String from a different Classloader and pass it to other classes. The class is declared final, but who cares, if you can just load a different class in a different classlaoder? This would cause huge security problems.

      Classloaders are implemented the right way. So don't change this (The exception messages could be improved though).

    5. Re:Point by point by Anonymous Coward · · Score: 0
      No, i++ is shorthand for "i.increment()". If you make ints etc immutable you can't do this, because it's like trying to write 1++, hence making all instances of 1 in the system into 2.

      Are we talking about the same language here?
      As is, the ++ operator is defined for numerical types, so there's no .increment at all.

      Let's take your viewpoint: ++ is an operation belonging to the object. As a counter-example, consider 1++. Does this change 1 to 2? No? Is it an error? Yes.

      However, if the ++ operator is the property of the variable, then there is no problem. You simply change the binding to point to a new integer object.

      Ruby has nothing to do with this. Python has integer objects, it even interns some of them. There's no .increment for integers, as it would make no sense.

    6. Re:Point by point by prefect42 · · Score: 1

      Deleting deprecated methods is fair enough. They're a support nightmare if they get any more out of hand (since all development on Java must maintain the functionality of deprecated methods). You've got to do it at somepoint, and either you slowly throw them out, or do it in one swift cull.

      The naming of methods/classes was wrong. When you learn java you realise it straight away. That would be a very minor pain to bear in terms of fixing old code.

      From the beginning I said Java hadn't gone far enough and made the mistake of having primitive types. Don't tell me you thing Integer et al is good.

      You appear to completely misunderstand the move to XML. What's the significance to servlets? The current serialisation format is bloaty and slow, not to mention the problems of versioning (which can be made easier).

      I think you're making light of his comments, they certainly echo (and exceed) the suggestions I've made within my research group.

      jh

      --

      jh

    7. Re:Point by point by lscoughlin · · Score: 3, Insightful

      Wow.

      Ok, all of your disagreements amounted to: "It doesn't affect me so i don't know but it shouldn't change anway", "I'm too lazy to learn a new way.", and "I can't think of a better way so there must no be one."

      About the most useless and long commentary i've seen in a while.

      Of course this response entire can be summed up as "You're dumb" and thus isn't real useful, but yeesh.

      --
      Old truckers never die, they just get a new peterbilt
    8. Re:Point by point by maraist · · Score: 2

      In the Summary part, there were these additional comments:


      eliminating checked exceptions (as Bruce Eckel has advocated),

      Don't know enough to understand what this means. Is he wanting to get rid of catch clauses?

      limiting objects to a single thread as in Eiffel

      My initial impression is that this is very good. I know that I was really worried when I first found that java only has single inheritance, but I've usually found work-arounds, and this definately seems a clean design.. Thus it shouldn't be too much of a stretch to accept this thread-isolation. I don't fully understand how it would work (do cross object method invocations require a transfer of run-time control? That seems terribly inefficient).

      I know that perl5.8 / 6 is using a novel method of thread control. The app is multi-threaded, BUT, each thread runs a fully independent VM. Variables must be explicitly shared. It just seems very clean.

      --
      -Michael
    9. Re:Point by point by nicestepauthor · · Score: 1

      I agree with a couple of points here:

      1). I don't love the AWT, but it has its place. If nothing else we need the classes java.awt.Component and java.awt.Container so we can create our own lightweight components without inheriting unnecessary baggage from Swing.

      2). Changing names for the sake of changing names is stupid, stupid, stupid. Just this morning I had to go back to using the deprecated methods getValue(), putValue(), etc. for a Session object because most programmers in my company are not using the very latest JDK. In a large company keeping everyone's IDEs up to date is a huge task that nobody has time for. I've seen several examples where deprecated methods were replaced with something else that was different only in name, and the name change was totally arbitrary (replacing "Url" with "URL" in a method name). I have to write code that is used by developers throughout the company and this kind of thing really bugs me.

    10. Re:Point by point by Keith+Russell · · Score: 4, Informative
      eliminating checked exceptions (as Bruce Eckel has advocated),
      Don't know enough to understand what this means. Is he wanting to get rid of catch clauses?

      Exceptions come in two flavors, and the difference is simple. Checked exceptions must be caught, Unchecked exceptions don't. If you call a method that throws a checked exception, you must catch that exception, or the compiler flags it as an error. If the exception is unchecked, you can call the method outside a try-catch block without complaint from the compiler.

      Interesting that Java has checked exceptions, .NET doesn't, and developers from both camps want things the other way around.

      --
      This sig intentionally left blank.
    11. Re:Point by point by Sembiance · · Score: 1

      I can't fathom how this got a score 5 of interesting.
      He basicaally disagrees with every point simply because he would have to rewrite his code (which he admit's he's already had to re-write twice in some cases).

      Besides, if you had to re-write your code I betcha it become 100 times better and much nicer to look at

    12. Re:Point by point by jwpalmer · · Score: 2, Informative
      Classloaders are implemented the right way. So don't change this (The exception messages could be improved though).

      Ack. The classloader architecture is one of the most poorly designed and inconsistently implemented parts of Java. The problem is that almost no one has to delve that deep into the doo-doo to get things done.

      However, if you're unlucky enough to be building an enterprise server architecture that requires separate classloaders (to avoid the JAR-version-hell of the classpath) get ready for fun:

      1. Half of the APIs in Java don't correctly use classloaders when they should. For example, when initializing the security API, you can't pass in a classloader - Java assumes that you will be using the standard classpath. WRONG!
      2. Statics allocated in classes are NOT garbage collected when the classloader is destroyed. So, if you use a classloader to manage your resources and allow a graceful stop and restart, all of your strings, objects, what have you will never get GCd. UNBELIEVABLY WRONG!
      3. The list goes on and on...

      As I said, the only reason that people believe the classloader API isn't broken is that they probably haven't had to use it. It needs serious help, above and beyond the ridiculously pervasive classpath issues.

    13. Re:Point by point by joe_fish · · Score: 2
      Nope. Wrong

      Not wanting to start again and re-write everything from scratch is not lazyness. It is common sense.

      Working Now has always and will always be better than Perfect Tomorrow.

    14. Re:Point by point by RovingSlug · · Score: 3, Interesting
      Ok, all of your disagreements amounted to: "It doesn't affect me so i don't know but it shouldn't change anway", "I'm too lazy to learn a new way.", and "I can't think of a better way so there must no be one."

      I'd say his commentary ammounted to "The ratio of benefit to breakage seems far less than one." And, I agree with him. Most of the proposed changes are nitpicking -- which is to say the final distance between the originial language and the "overhauled" language is not very far, and for all that effort, you bought incompatability.

      Give me templates and typedefs. Those are changes worth breaking the language over. Those are suggestions that can hold their weight in a "Top 10 Java 3" list.

    15. Re:Point by point by Anonymous Coward · · Score: 0

      ok, from a marketing point of view, I think I agree with most of your assesment, but not considering "upwards compatibility", which is pretty much saying, "fuck off" to all your customers, I like some of his suggestions.

      * I think sun needs to have a max lifetime for deprecated fields, methods, etc. not just mark something as bogus, and forget it.

      The only thing that really suprises me, is that nobody has noticed the striking similarities between these proposed changes and c#. c# does boxing, which allows primitives to be stored into collections without wrapping them in a class. it has XML as its base for serialization and configuration. it definitely has a very well established GUI api, forms, which any visual basic weenie can figure out. it even has qt and gtk bindings, which is really cool. it has async IO. It's this guys java3.

      I'm not a microsoft advocate, and I'm not trying to sell my books or advertise for time o'reilly, I'm just making an unbiased observation. So as far as I'm concerned, it looks like microsoft really did innovate this time. well at least for Eliotte.

    16. Re:Point by point by Oink.NET · · Score: 2

      This kind of "you'd better not break my existing code" whining is exactly what the Visual Basic folks did when Microsoft revamped their precious language into VB.NET. What did the rest of the world say to them? "Get over it." These language Luddites should get a copy of "Who Moved My Cheese" and read it.

    17. Re:Point by point by UnclePaeng · · Score: 1

      No, i++ is shorthand for "i.increment()". If you make ints etc immutable you can't do this, because it's like trying to write 1++, hence making all instances of 1 in the system into 2

      The String class is immutable and yet you can still say String a = "Hello"; a = a + " world". When you perform operations such as the autoincrement operator on immutable objects, it doesn't frickin change the object, it creates a new object and reassigns the variable to that new one. So, in short, if int were an object, then i++ would work since a new object would be created that contained the value of i+1 and i would be assigned to that newly created object. This means that all instances of 1, for example, will NOT be converted into 2. Yes, immutable means that the value cannot be changed, but it doesn't mean the variable can't be reassigned to a new object with the new value!

    18. Re:Point by point by Fweeky · · Score: 2
      The String class is immutable and yet you can still say String a = "Hello"; a = a + " world"
      Yes, this is creating a new String object and assigning a to it. It's nothing like changing the string object itself.

      a is not the object, a just happens to point at the object.
      When you perform operations such as the autoincrement operator on immutable objects, it doesn't frickin change the object, it creates a new object and reassigns the variable to that new one.
      How do you do this while making ++ a method on the Numeric object? How do you give it the power to change what a variable name points to? Typically you'd return the next object, but without an assignment there's no place for the return value to go.

      You *could* make it magic and mean foo += 1, or make it take the return value and assign it to the lvalue, but it doesn't mean it's a good idea. It's certainly not going to make the language any cleaner or easier to write or understand.
    19. Re:Point by point by curunir · · Score: 2

      I don't think anyone is suggesting that we completely do away with Java 2. Heck, how many different 'current' versions of the Linux kernel exist? There's plenty of businesses that still use the 2.2 kernel because that's what they've tested against and trust for their environment. At the same time, those businesses aren't holding back development on the 2.5 kernel, so I get all the cool stuff that they wouldn't have been able to add to the 2.2 kernel.

      Something similar could be done here. I'm sure Java 2 could continue to be extended to fit the needs of people with who need backwards compatability. But why should those of us who don't need backwards compatability be held back because you wrote your code for a platform that was still in the early stages of its evolution?

      If there are fundamental problems with the language (and I think most people would agree there are), those problems need to be addressed. And if backwards compatability is the price of addressing those problems, so be it. Sun has made a commitment to support businesses who have developed for Java 2. That commitment wouldn't go away with the advent of Java 3.

      Maybe you should look at it from someone else's point of view instead of just thinking "how much code would I have to re-write?" I have huge amounts of code written for Java 2. Am I going to re-write it? Hell No! But would I want to have the opportunity to develop new projects in a Java 3 environment? Abso-Freakin'-Lutely!

      You can go through point-by-point and poke holes in his suggestions, but are you actually suggesting that Java 2 doesn't have some pretty serious problems that would be easier to fix if it wasn't limited by being backwards compatable? Didn't think so.

      --
      "Don't blame me, I voted for Kodos!"
    20. Re:Point by point by MillionthMonkey · · Score: 2

      10. Deleting all deprecated methods- what is the point of removing them? So the JVM libraries load a few milliseconds faster? Yet in the same article he suggests replacing primitives with objects, and pulls out Moore's Law as a rationale. The change is pointless.

      9. Changing InetAddress to "InternetAddress", and changing "java.sql" to "javax.sql"- this just creates busywork. Why don't we just go through the English language and change the spelling of all the words so they're more consistent with how they're pronounced? That would make even more sense and make English easier to learn. If you disagree it's because you're lazy.

      8. Eliminate primitive data types- This is a bad idea, and the article admits it- with the two words: Moore's Law. When you hear someone advocating some feature and they start talking about Moore's Law, you know right away it's a stupid idea. Each Object in Java incurs a 16-byte overhead from the JVM implementation. So a byte would use 17 bytes. And immutability for thread safety? Yeah, what about "i++"? How does equals() work? How does == work? Newbies already have this problem with strings (e.g. when they write if (option=="Y"). Now they'll have it with ints, floats, etc. And immutability for thread safety- oh man! The reason java.lang.Integer, java.lang.Boolean, etc. are so useless is that they're immutable. All they're good for is when you need to pass a primitive to a method that only takes Objects. A more rational way to deal with this is to introduce templates into the language. This is a big fix to a non-problem, designed to make OO aestheticians happy in their ivory towers. For anyone writing real code, this would be a disaster.

      7. Extend chars to four bytes- breaking just about every program out there- so we can cram Linear B into the charset? \u00000046\u00000075\u00000063\u0000006B that!

      6. Fix threads- see # 10. Yes, as far as I can see there are some good points here, but none justifying an upgrade breaking compatibility. As far as an object having multiple locks for different operations- this is easily doable without mangling the language syntax. Just add "getXSyncObject()", "getYSyncObject()", etc. to your object and have it return different lock objects for operations X and Y, and then synchronize on the objects returned by those methods.

      5. Convert file formats to XML- "I want XML and I want Sun to do it for me!" I can guarantee you that any XML format dreamed up by Sun/JCP committees will be about as detailed, useless, and version-fragile as the default binary serialization we have now. Write your own serialization mechanisms that return XML you write yourself. Stop being lazy.

      4. Ditch the AWT- Do this and I will HUNT YOU DOWN AND STRANGLE YOU. We never use Swing at our company because a "Hello World" in it loads 20 megs of classes. Everything uses AWT and our programs can actually run for more than an hour without crashing. (Although Sun has not been maintaining the AWT at all since Swing came out.)

      3. Rationalize the collections- What's the point of doing this? They seem rational enough to me. More busywork. See #9.

      2. Redesign I/O- This has been done already in 1.4.

      1. Class loading- Actually, once you realize that a classloader defines its own namespace, this can become a useful feature. I don't see why it should be removed simply because some people don't understand it.

      About the most useless and long commentary i've seen in a while.

      His post was articulate and brought up a good rebuttal to each of the points in this article. It deserved its 5 much more than yours did.

    21. Re:Point by point by SpryGuy · · Score: 1

      Well, checked exceptions must be caught OR DECLARED TO BE THROWN. You don't HAVE to catch them the moment they're thrown, they just have to be caught eventually.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
    22. Re:Point by point by Hugo+Graffiti · · Score: 1
      Exceptions come in two flavors, and the difference is simple. Checked exceptions must be caught, Unchecked exceptions don't. If you call a method that throws a checked exception, you must catch that exception, or the compiler flags it as an error. If the exception is unchecked, you can call the method outside a try-catch block without complaint from the compiler.

      java.lang.Error is effectively an unchecked exception.

    23. Re:Point by point by TummyX · · Score: 1


      How do you do this while making ++ a method on the Numeric object? How do you give it the power to change what a variable name points to? Typically you'd return the next object, but without an assignment there's no place for the return value to go.


      The point is there IS an assignment. i++ is the same as i = i + 1.

      It's no different from saying:

      String s = "hello";
      s += " world";

      (primitive) i++ CHANGES the value of "i" just as (object) i++ CHANGES the reference of "i".

    24. Re:Point by point by TummyX · · Score: 1

      Um any exception extending RuntimeException is unchecked.

    25. Re:Point by point by Fweeky · · Score: 2
      No. Not unless you're going to hack it about to make it so.

      String s = "hello";
      s += " world";


      This produces three objects - "hello", " world", and the "hello world" produced by concatinating them. There's no in-place changes going on here.

      "hello world" <- "hello".+(" world")

      i++ is more equivilent to:

      "hello" << " world";

      Where the string "hello" is asked to concatinate " world" onto itself; changing "hello" directly. Of course, with immutable strings, you can't do that, unless you're willing to magically turn it into an assignment too.

      If you're going to make your int an immutable object, then call 1.++(), 1 has to deal with it itself. How exactly do you make 1 know who's referencing it? Why on earth would you even concider letting it?

      About the only way I can think of is a transparent proxy object that will track the return values of these methods, so all the variables pointing to it actually only see the proxy containing an object that changes.

      Sure, you *could* just hack it so when the compiler see's i++ it writes i += 1, or i = i.next, but that doesn't mean it's the same thing, and you'll really notice that when you start referencing objects from multiple points and use i++ expecting it to change the object when it really changes the actual object i is pointing to.
    26. Re:Point by point by TummyX · · Score: 1

      I'm sorry but you're just wrong.

      You're confusing byref semantics with byval semantics.


      Sure, you *could* just hack it so when the compiler see's i++ it writes i += 1, or i = i.next, but that doesn't mean it's the same thing


      That's EXACTLY what i++ does. It does it on the stack. The code would look something like this:

      load i
      push 1
      add
      store i


      and you'll really notice that when you start referencing objects from multiple points and use i++ expecting it to change the object when it really changes the actual object i is pointing to.


      ints (like other primitive types in java) are NOT REFERENCE TYPES. They are VALUE TYPES. THERE ARE NO REFERENCES TO WORRY ABOUT. You can't reference "i" at all. All you ever do is get a copy of the value "i". And ofcourse for VALUE TYPES, changing any value of that value-object will only cause that object to change.

      e.g.

      int x, y;

      x = 10
      y = x;
      x = 20;

      y is still 10 (obviously).

      int x, y;

      x = 10;
      y = x;
      x++;

      y is still 10. And it doesn't matter x++ means x = x + 1 or x.addone(). Both would change the VALUE of x to be 11. The result would both be the same. If x was stored on a stack (because it's a local variable) the actual value on the stack would (in both cases) be changed to 11.

    27. Re:Point by point by Fweeky · · Score: 2

      Um, no, I'm talking in terms of ints as immutable objects, not primitive value types.

      Think of how you'd implement it *now*, with a wrapper class around int. All "1"'s in the system will be a reference to your immutable "1" object instance, so without help from the compiler you cannot make a "++" method increment the value, because that means changing the object.

      You either make them mutable, or you make "++" into another assignment operator.

      Obviously it's *possible*, and for Java where it's used so often it's perhaps even a good idea, but that doesn't make it particularly clean, since it just complicates the language for the sake of saving a bit of typing.

    28. Re:Point by point by AMNESIACX · · Score: 1

      Its plainly possible to retain integer incrementsation (ie i++) regardless of type. It's the same inherent language-level operator overloading as is currently performed using concatenation (eg "string" + 5 produces "string5", so why couldnt i++ behave as it has always?). Remember, an object is simply a reference to an address space, what the JVM does with the contents in that space is discretionary and abstracted from the programmer.

      --
      "It's not just what you say, no it's mostly how you feel it." - Tim Buckley.
  28. We don't need more incompatable languages... by Anonymous Coward · · Score: 1, Interesting

    ... we need to fix the ones that we have. I have used five diffrent languages already, and I am only a student of programming.

    Making a varsion of a language that is incompatable with all previous ones would be ludicrious, especially on an intreprited language such as java. I can see joe blow sitting in front of his computer trying to figure out why his java solitare game won't run, even though he has just downloaded the latest and greatest java3 engine. All the hours that the planet has collectively put into to Java 1.x.x would then turn into a grand waste of time.

    I am not saying that there is nothing wrong with Java though, the backend needs some work. But that can (and should IMHO) be transparent to us programmers. We need new, faster VM's to run the code on the host machines. The windowing toolkits need an overhaul, and we should do away with AWT almost completely. But all of this can be done in such a way that the old stuff still runs. (They have smart people at sun, they can find a way....)

    Adding pointers and memory management would be nice, but what would we do for cross-platform compatability then? I can just see the mess we'll get when our pointers refuse to work on the palmos/ sun/ pocketpc/ OS11/ whatever version of java...

    -unused_user_name
    (The thing wouldnt let me log in BTW)

    1. Re:We don't need more incompatable languages... by Anonymous Coward · · Score: 0

      I would suggest that existing byte code should run in the new VM, but that new compilers make the changes suggested.

      My 2 bits.

  29. Missing the essential by vlad_petric · · Score: 3, Insightful
    The strongest anti-Java argument is its speed. While important progress has been made, key features of the Java architecture make it inherently slow. For instance the fact that the architecture is stack-based makes bytecode very difficult to optimze on machines with a large number of registers

    So in my not-so-humble opinion what Java needs greatly is a completely redesigned & revamped architecture (bytecode & JVM) with compatibility modes, of course.

    Most points discussed in the article are just library-related. Those simply do not justify a new major release.

    The Raven

    --

    The Raven

    1. Re:Missing the essential by pr0nbot · · Score: 1

      This could be easily implemented with a classfile version number change; a JVM seeking to be backwards-compatible would need to be able to cope with both stack- and register-based bytecode, but the Java language itself would not need to change, only the bytecode format.

    2. Re:Missing the essential by CynicTheHedgehog · · Score: 3, Insightful

      And these arguments are based largely on the performance of Sun's JVM. Is Sun's JVM the fastest one out? I don't know, but on many systems it's the only available JVM. Apparently Apple's OSX JVM is pretty speedy, and IBM's got one that is at least as good as Sun's. I'll bet that you can take the existing architecture and make an efficient implementation.

      Or you could look at it this way: the JVM is like an operating system. It handles threads, scheduling, memory management, I/O--this list goes on. And as in an operating system, design choices made for each of these subsystems have an effect on overall performance. Certain scheduling algorithms, for instance, favor I/O-bound processes, while others favor CPU-bound processes. I bet Sun compromised in a lot of areas of their implementation in order to get decent performance overall. I'm sure different implementation decisions will have different results. There just aren't a lot to choose from.

      And Sun was targetting a server-side market from the start. So it's probably safe to say that their implementation favors the Sparc in all its 64-bit glory. I'm sure if someone really focuses on the desktop and kept Swing in mind they could come up with something better for the end user.

    3. Re:Missing the essential by ranulf · · Score: 3, Insightful
      For instance the fact that the architecture is stack-based makes bytecode very difficult to optimze on machines with a large number of registers

      This is just plain wrong, I'm afraid. It just requires that you don't take a simplistic approach converting bytecode to native code.

      If you're converting a function from byte-code to native code, you can easily look at a stack based bytecode and build up a full parse tree for each statement and optimise that for the target platform.

      Besides, how many registers would your ideal JVM have? 4? 8? 32? 256? What if it's run on a machine with more registers? It just won't use them. What if it's run on a machine with less? Well, it'll have to start swapping registers to memory back and forth, and become very inefficient. Using a JIT and a stack based approach, the target code is optimised for the host machine and the JIT doesn't have to worry about what "registers" the code is using for what.

      Perhaps Donald Knuth sums it up better: "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil."

      If you weren't talking about a JIT but a byte-code interpreter, then you'd probably be implementing registers in an array anyway, so your comment doesn't make too much sense.

    4. Re:Missing the essential by alext · · Score: 2

      I think I've found a solution!

      Use Jad first to turn the bytecode back into full source code, and then optimize that.

      Brilliant, eh? I feel a software patent filing coming on...

    5. Re:Missing the essential by j3110 · · Score: 2

      My god man! The JVM doesn't have registers nor stacks. You simply refernce the variables. The JVM itself decides weather a variable is a register or whatever the system supports. That's why Java was written to begin with, to improve portability. Most people can't optimize their C/C++ programs for all CPU's. So, they invented a very very CISC VM. That way a program written in Java can take advantage of all 32 MIPS registers or the 8 or so x86 integer registers and the floating point stack.

      Java isn't slow, java loads slow.

      --
      Karma Clown
  30. Re:0. -- Do it himself? by Silverstrike · · Score: 1

    I doubt that it would be possible for anyone to fix the entire Java language by themselves. Compilers are tricky things to write, not to mention a fully-featured/multi-platform language like Java.

  31. Java 1.5 = Java 3 by dukoids · · Score: 0

    Java 1.5 will add autoboxing for primitive types and typed containers. Breaking compatibility seems neither a realistic nor a good option. Concerning AWT and SWING issues, I'd like to recommend to take a look at the SWT of the Eclipse project.

  32. but, a question.. by Anonymous Coward · · Score: 0

    which are better, (bush's) baked beans, or (van camp's) pork and beans?

    i know ed gein was a big pork and beans fan..

  33. Really? I thought fixing other things by Anonymous Coward · · Score: 0

    Things like - 'java lets you write once and run everywhere'.

    Java *DOESN'T* "run everywhere" as the original Sun mantra stated.

    If you are going to flap your yap about what Sun "needs" to do, start with getting Java to do what it was supposed to do...run everywhere.

  34. upward compatability work around? by chobee · · Score: 1

    In the last 2 developement environments I've worked at we've always kept several version's of java on each system. When a new version was released we added that to the system leaving the old version also so that developers could put either version in their path. So if this theoretical version 3 was released why can't maintainer's keep an old version in place as well?

  35. Ada for threads by polar+bear · · Score: 1


    Java was the first major language to integrate multithreading as a fundamental feature rather than a special purpose add-on library.

    Except Ada83 which is ... umm ... 2002 minus 1983 is 19 years old!

    There are probably others too.

  36. Class loader by seldolivaw · · Score: 2

    One point he mentions is making the class loader better -- but he doesn't know how. Amen! I hate the fscking class loader!! :-)

  37. Re:Relax, light up and have a cigarette by Anonymous Coward · · Score: 0

    i can't find your camel section. do you sell these? thanks in advance.

    yrs, pinchpenis

  38. Fill in the blanks by d3xt3r · · Score: 3, Informative
    BTW, the blank overhead was supposed to be SMP. Java threads that take advantage of SMP are a requirement for server side tasks. Again, Sun's Solaris and Linux JVMs and Apple's OS X JVM, all already take advantage of this.

    So much for proof reading. :)

  39. If Java were truly open by Anonymous Coward · · Score: 0

    You could do it yourself.
    But Sun owns it, so you can't.
    Why don't people use a free JVM-workalike like Kaffe to implement these ideas?
    Eventually you could opt not to use Sun's Java at all.
    It seems like Sun is hindering the evolution of Java.

    1. Re:If Java were truly open by Perdo · · Score: 2

      Think Linus: All the unices were unfree or could be incorperated into unfree products without giving anything back to the community. Linux created his own unix kernal from scratch and distributed it under the GPL.

      Microsoft created a Java work alike in C#. Someone will eventually create a Java worK alike and GPL it.

      --

      If voting were effective, it would be illegal by now.

    2. Re:If Java were truly open by Anonymous Coward · · Score: 0

      And therefore, Linus failed to create a free "unix".

  40. Do it yourself. by oliverthered · · Score: 1

    Some people are good at some things and some people are good at others.
    You could be a great designer, but be crap at building things. It's better that you stick inside you skill set and don't cross into things you'r not good at, that do do some really good design a make a hash of the implementation.

    Patient: 'Doctor I have a problem with my leg.'
    Doctor: 'Ahh I see I think it's this but I'll just phone the consultant'
    Patient: 'Will he come round and fix my leg?'
    Doctor: 'No he's a consultant'

    --
    thank God the internet isn't a human right.
  41. Hang on a second... by cca93014 · · Score: 1

    What's all this about Java 2? I thought we were on version 1.4...?

    Hmmmm.

    1. Re:Hang on a second... by Anonymous Coward · · Score: 0

      We are. Version 1.4 of Java 2. It's mostly a marketing thing, but the Java 2 language really is different than the original Java. For example, it has inner classes. (I think that was one of the changes...)

  42. boozy barroom chats by k2enemy · · Score: 1
    If we're redesigning Java threads, maybe we can move this discussion from boozy barroom chats to a serious discussion and figure out if there's some way to reconcile the two sides.

    people that get into arguments about thread implementation at the bar deserve our attention on the issue.

  43. Hidden A.D.S. A.P.I.? by PGillingwater · · Score: 1

    The original Java developers were Unix programmers, Windows users, and Mac dilettantes. The I/O APIs they invented were more than a little Unix-centric in both obvious and not-so-obvious ways, and really didn't port very well. For instance, initially they assumed that the file system had a single root. This is true on Unix, but false on Windows and the Mac. Both the new and old I/O APIs still assume that the complete contents of a file can be accessed as a stream (true on Windows and Unix but false on the Mac).

    I'm no Java expert, but I'm sceptical that *all* the contents of a Windows file can be accessed as a stream. What about the hidden NT Alternate Data Streams? They can't be deleted (apart from the file to which they are attached), and can even be attached to directories. This is analogous to the Macintosh Resorce Fork.

    --
    Paul Gillingwater
    MBA, CISSP, CISM
    1. Re:Hidden A.D.S. A.P.I.? by pboulang · · Score: 1
      You mean the streams that most MS products can't even access?

      While theoretically interesting, I have yet to find a practical use for these "extra" streams. Not even good for data hiding as you cna never be sure of which version of copy/xcopy/dragondropping will preserve the info.

      --

      This comment is guaranteed*

      *not guaranteed

  44. He's a critic by zeus_tfc · · Score: 2

    And I hope we all remember that critics are like eunuchs (as opposed to unix) in a harem: They know how it's done, they've seen it done every day, but they're unable to do it themselves.

    Or so sayeth Brendan Behan.

    --
    "...At the end of the day"..."when everyone goes home, you're stuck with yourself." RIP Layne Staley
    1. Re:He's a critic by kubrick · · Score: 2

      Those who can, do.

      Those who can't, teach.

      And those who can't even do *that* become critics.


      Too lazy to look it up, but it wouldn't surprise me if an author was the source of that comment. :)

      --
      deus does not exist but if he does
    2. Re:He's a critic by miniver · · Score: 2

      I always heard it this way:

      Those who can, do.
      Those who can't, teach.
      Those who can't teach, administrate.
      Those who can't administrate, criticize.
      --
      We call it art because we have names for the things we understand.
    3. Re:He's a critic by kubrick · · Score: 1

      I don't know, I'd put administrators and managers on the same level as critics myself. :)

      --
      deus does not exist but if he does
  45. Some observations by Twylite · · Score: 5, Informative

    This is a refreshing view on changes to Java, because it doesn't make the traditional calls for templates, a preprocessor, and operator overloading. Most of the article is well considered and logical, and should be implemented in a move to Java 3.

    There are however some issues with which I must disagree:

    • Under the discussion of primitive types, the author proposes that the current wrap-around handing of primitive types is incorrect. Mathematically, yes - but not in computing terms.
      While the overhead of promoting all primitive types to objects may be insignificant, the overhead of checking all arithmetic for overflow does have the possibility of causing significant overhead.
      Not only that, but you will still end up with a RuntimeException, because you cannot expect ALL arithmetic to be in a try ... catch block. So all this becomes is an aid in debugging or forcing a crash (rather than progress based on an invalid computation) on a live system. I have to question whether the performance trade-off is worth it.
      Overflow errors are a well known problem - well-written software should not suffer from them.
    • Still on the primitive types discussion, I don't believe the author has considered the impact of using an arbitrary-size number computing which does not require such numbers. The performance overhead is potentially huge, and you lose the ability to performance a large number of optimisations based on the fact that you are dealing with a quantity of a determistic size (in memory). There are also threading and synchronisation considerations, which I will discuss later.
    • The byte type is unfortunately defined in Java. It should be unsigned, to begin with. It is certainly necessary for many IO operations, and data encoding/decoding; moveover it would be preferable if bytes had the special property that aritmetic operators converted other types to bytes (even if data loss was involved) rather than vice verse.
      Many Java developers are caught by using code like b = (byte)i; rather than b = (byte)(i & 0xff);. It is generally true that when dealing with bytes, you want to keep data as bytes until you explicitly make it into another type.
      Finally, byte arithmetic should always overflow, as is expected in CPUs.
    • Last note on primitives (and it applies to 4-byte chars as well): the assumption we are afforded by Moore's law does NOT apply as the author suggests. Rather, what was designed to run on a low-end Sun or 486 Intel PC is now expected to run on a 1Mhz 8-bit CPU with 32Kb memory.
      While J2ME is not fully Java-compliant (no floating point support, for example), it still largely conforms to the write-once test-everywhere rule, and this is part of Java's attractiveness.
    • Onto the size of chars. This is a bit of a tough one -- which it would be nice to have a 4-byte character, I have dealt with several Java applications which were very String-intensive. They could gobble up 256Mb RAM in a matter of seconds. A 4-byte char only worsens this problem. It is even doubtful that a char object (as opposed to primative) would help, given the overhead that would be associated with the object (at minimum a type and representation lenght - you're back at 4 bytes again).
      More memory is not always a good solution. Java's garbage collection architecture is very wasteful of memory at the best of times; at the worst of times you are using immutable objects like Strings, so you can't pool or reuse the objects. As increasingly more applications handle text because of our new XML obsession, this situation becomes worse.
    • Threading next. I have studied Java's threading model in some detail, including the issue of non-atomic longs. The problem comes down to one of efficiency - again.
      Java implementations typically do not emulate threads on their most common platforms - they make use of the native threading model of the operating system. This means that making a 64-bit operation atomic must involve the use of a lock; so instead of a 64-bit operation taking up 4 times the time of a 32-bit operation, it could take that plus two calls into kernel space.
      As mentioned before, the same is true of using arbitrary-size numbers. Only a number that the CPU can treat atomically will result in an atomic operation without additional synchronisation.
    • With regard to monitors, I fail to see the need for multiple monitors per object. Every object is a monitor, and Java syntax provides for implicit synchronisation on the current object as well as explicit synchronisation on an arbitrary object.
      Thus, to have different types of operations (all implemenented in one object) synchronised on different locks, simply use each in an explicit synchronisation block and have private or protected lock objects specifically for that purpose.
      Decoupling monitors from objects would kill a lot of the ease-of-use that makes Java threading such a pleasure by comparison to many other models.
    • On the other hand, there are many weaknesses in Java threading. It lacks a strongly-defined policy for thread scheduling, which can make the design of complex multithreaded applications very difficult.
      Furthermore it ONLY has monitors as locking primitives, which rules out the use of overlapping locks, which are one of the few effective synchronisation primitives which can overcome weakly-defined scheduling.
      Java would do well to add an additional synchronisation primitive - either mutexes (as error-prone as they are), or interlocked increment-and-compare (which can solve a number of synchronisation problems far more effectively than mutexes).
    • Onto the XML question, and getting to my area of pet hate: The XML Silver Bullet.com. The author's bias towards XML is understandable, but he needs to realise, as do the millions of developers who let the marketting machine think for them, that XML is a poor implementation of a decent idea.
      For a better critique of XML take a look at http://www.eastcoast.co.za/twylite/pml/pml.html" >my anti-XML page (incomplete, but the anti-XML rationale is presented).
      In particular, XML is a very poor choice for the encoding of Java objects, because of its lack of terseness, and the relatively slower speed of parsing XML - both of which impose significant penalties in a distributed environment.
      Some hard facts to back up these claims: in an application I have worked on, we experimented with SOAP instead of our original binary protocol. The result was a 80% decrease in call rate.
      In a few years, the XML phenomenon will wear off, and world+dog will wonder why we are wasting our precious bandwidth on all the overhead. Already WS developers are starting to wonder how it will affect their resources, and we have proposals for a binary encoded XML for the mobile world.
      This "simple" specification is too complex and too overkill for most tasks, so every "lightweight" XML parser on the market conveniently leaves out certain parts of the specification - be it DTD, PI, CDATA, whatever. We already have XML documents that aren't compatible between two parsers, the situation will only worsen.
      And in the end we will realise that it isn't necessary to make computer data human-readable, because really, everything is just a bucket of bytes and a rule on how to view it, and XML is a very, very poor rule.

    Java is not perfect. It is not a silver bullet, and it is certainly not everything to everyone. Instead, it offers an environment that, to a lot of people, is a damn sight better than C++ because it avoids the error-prone complexities and power of the latter. But you must accepts its weaknesses as a trade-off.

    --
    i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  46. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  47. Fix the JVM, Let Others Fix the Language by FreeUser · · Score: 5, Insightful

    As another noted, the JVM is already capable of running multiple processes on Mac OS X. Fix the JVMs for GNU/Linux, FreeBSD, Solaris, and those obscure, mutually incompatible operating systems from Redmond :-), and let others fix (or replace) the language.

    Concentrate on the JVM.

    Already Python can be compiled into java bytecode, and if the capability doesn't already exist for Ruby, it will soon. Similar compilers could be created for any number of other languages (scheme, smalltalk, whatever).

    Java isn't what is important, it is the write (bytecode) once, run (bytecode) anywhere that is important. Whether that bytecode is generated from Java, Python, Scheme, Ruby, or Joes New Language For His CS210 course, doesn't really matter.

    --
    The Future of Human Evolution: Autonomy
    1. Re:Fix the JVM, Let Others Fix the Language by pmz · · Score: 3, Interesting

      Java isn't what is important, it is the write (bytecode) once, run (bytecode) anywhere that is important. Whether that bytecode is generated from Java, Python, Scheme, Ruby, or Joes New Language For His CS210 course, doesn't really matter.

      I'm suprised that this fact just doesn't come up often when debating Java vs. the .NET runtime. Any language that will work well on a stack-based architecture will compile very nicely to the JVM.

      Even though I really know nothing about C#, I suppose even it could be ported to the JVM, because C# is touted as a Java clone. Microsoft markets a "migration path" from Java to C#; does Sun do something similar for C# to Java? I have seen that there are Visual Basic to Java options.

      Another interesting question is whether the GCJ implementation can handle non-Java bytecode. Imagine being able to write Java, Scheme, or Python source, distribute it as bytecode, and, if the end-user wants native binaries, they just run it through GCJ. JVM + GCJ has a lot of potential to be very formidable against .NET.

    2. Re:Fix the JVM, Let Others Fix the Language by crisco · · Score: 2
      This is probably the most important comment I've read.

      I think the author of that article even touched on this possibility. The only issue is one of acceptance. Java programmers (except those guys from IBM) have come to accept Sun ONE with a whole different meaning, if it doesn't have Sun's blessing it isn't really Java and it isn't really worth using.

      The real issues are the proposed changes to the class library and the real VM changes underneath everything. The class library changes could proabably be accomplished easily, the VM less so. But whats stopping anyone from writing a Jython style bytecode compiler for the proposed Java 3 and calling it Coffee Ground 3 or some such thing? Throw in the proposed library changes as a sort of 'wrapper' and you at least have a proof of concept version. But again, without Sun's blessing, without BEA and Jbuilder and such coming on board, you're without enough mindshare to get the market traction that would make this worthwhile.

      --

      Bleh!

    3. Re:Fix the JVM, Let Others Fix the Language by Per+Bothner · · Score: 1
      Another interesting question is whether the GCJ implementation can handle non-Java bytecode. Imagine being able to write Java, Scheme, or Python source, distribute it as bytecode, and, if the end-user wants native binaries, they just run it through GCJ. JVM + GCJ has a lot of potential to be very formidable against .NET.

      Yes, GCJ can handle non-Java bytecode. If Kawa is configures --with-gcj it will use GCJ to compile itself, including bytecode generated from Scheme. The result is a shared library made from source code in Java amd Scheme. It will also create a script that makes it easy to compile Scheme or XQuery to native executable.

    4. Re:Fix the JVM, Let Others Fix the Language by Per+Bothner · · Score: 1

      (Oops - meant to hit preview.) This is the correct URL for Qexo (Kawa-XQuery).

  48. Deja vu all over again by Anonymous Coward · · Score: 0


    But what if it's not just your code that needs refactoring? What if the language itself has inconsistencies, inefficiencies, and just plain idiocies that need to be corrected? When you get right down to it, the entirety of Java is really just like any other large code base. It has some brilliant parts, some functional parts, and some parts that make just about everyone scratch their heads and ask, "What the hell were they thinking?"

    Reminds me the good old arguments against using C++. Isn't Java supposed to be a revamp of C++. I guess Bjarne Stroustroup was right about what is going to happen to Java.

    Later

  49. Realize. . . by Tim12s · · Score: 1

    Realize that it needs to happen someday.

    ---

    Realize that his 10 points arnt all correct, but most of them are well justified through other papers and significant work outside his article.

    I fundamently disagree with his argument about the primitives and their objectification (a word?). Instead I advocate type-signficant templates and language support to naturally extend collection support to leverage primatives in the collections.

    I would also advocate more primitive types that better cater for the real machine level issues.

    I strongly disagree with #5, the serialization of objects using the XML file format. Where speed is necessary, XML is insignificant. (Ideally, the XML standards org needs to define a compact binary format for XML. That would be good. Using the current XML text based xml fileformat is crazy, if only usefull for final stage output storage.)

    His #1 is flawed, and should not be his #1 priority.

    ---

    Realize that the only real way to implement the proposed changes in Java3 is to provide a 'compatability' layer between prior versions.

    This means it should be possible to install 'clean' libraries, or 'compatability' libraries.

    I would hesiate to be too quick to move to Java3. as there are more than 10 aspects need to be tackled.

    A difficult task in the real world of business and legacy. I hope it happens within the next 3 years.

  50. Java is like candy by dachshund · · Score: 1
    according to this [google.com] whitepaper, when developers are given their preferance of language to use to implement a solution, they're most productive.

    I'm fairly proficient in C++ (it's been my primary language for years), and I'm more comfortable using it than just about any other language. However, while I would use C++ for a production application every time, I recognize the advantages of using Java for building prototypes and simple test apps. Between the much simpler library, thread support and garbage collection, you can really do a lot more in a short time without planning or worrying about memory.

    A friend of mine said it best, when we were forced to use Java for a compilers class: Java is like candy. Meaning that so many of the details are taken care of by the language that it's almost effortless. You can do things quick and dirty, in a way you wouldn't in C++. Of course, all of that ease and sloppiness comes at a cost, and in some instances that's acceptable.

    Besides, Java and C++ are so similar anyway. If you're comfortable with C++, there's absolutely no reason why you shouldn't be comfortable in Java. You might not be as proficient as a full-time Java coder, but you're not exactly going to be lost without a paddle. Going the other way, I'm not so sure.

  51. Improving Java by thomas.galvin · · Score: 1
    10. Delete all deprecated methods, fields, classes, and interfaces.

    This one is a no-brainer. Just about all of the real programmers I know remove deprecated calls from their code as they are encountered. If something has been deprecated, it was probably for a good reason. Leaving these things in the language only serves to build cruft.

    9. Fix incorrect naming conventions.

    One of the things that I like best about Java is the internal consistency; many times, I can guess the correct method to call simply because simmilar methods exist for other objects, Still, Harold is right; there are a few places here and there where imporvments could be made. Is it String.size() or String.length()? Little things like that should be cleaned up. It's still a far cry better than C++, but it could also be better.

    8. Eliminate primitive data types.

    I disagree with this one. As a semi-interpreted language, performance has always been precieved as one of Java's faults. There is no reason to complicate matters by promoting primitives to objects. There are some cases when this would be useful, especially when using the container classes, but I think this will be better solved by the "auto-boxing" of the upcomming Java release than by defaulting all fields to objects.

    There is no need for primitives to have inheritance; they would almost certainly be final anyway, and providing them with methods such as int.compareTo(int) would just clutter mathematical code. I say leave them as they are, and box them as necessary.

    7. Extend chars to four bytes

    I can see his point; Unicode is getting huge. Still, I'm not sure justifies doubling the space every character takes up; perhaps a new unicode type would be better. Of course, to be of any use, String would have to default to this new type, so I might just be gull of hot air on this one.

    6. Fix threads.

    I'm not a thread expert either, so I'll keep my mouth shut except to say Java's thread support has been sufficient for my needs.

    5. Convert file formats to XML.

    I don't see any problem with this. As Harold indicated with his mention of XMLEncoder/XMLDecoder, Java is already moving in this direction, and since XML is becoming a de facto standard anyway, I say jump on the bandwagon. I would also like to see JEditorPane expanded to include support for an XML file format; if it was compatible with OpenOffice, so much the better.

    4. Ditch the AWT.

    This one gives me nightmares...I have a lot of GUI code laying around, and having to rework all of it...ah well, that's what weekeneds are for, right?

    Harold is right, the AWT is out-dated and poorly named (there isn't very much about the AWT that can be considered advanced), and lacks the functionality for real GUI design. SWING can always be improved, but in general, I like what it provides.

    One thing I do take issue with; converting JFrame etc to Frame. This might be more logical, and is what would have been done if AWT hadn't claimed all of those names already, but I like being able to hit the documentation and look at all of the Jbar, Jfoo classes and know that I'm seeing the SWING stuff.

    3. Rationalize the collections.

    Again, he is right in claiming that consistancy is important, but I don't see any reason to remove Vector or Hashtable; these are the only containers I use with any regularity, and most people coming from a C++ background will be the same way. If I spent the time to investigate ArrayList or HashMap more, I might convert, but for the sake of intuitivness, I still think that the Vector and Hashtable names should be kept if the classes are merged. Also, Vector and Hashtable are synchronized, ArrayList and HashMap are not. Thread safety is almost always nice.

    2. Redesign I/O.

    Ugh. Yep. I have never been a fan the way Java handles IO. Perhaps I was spoiled by C++. Perhaps it was just because I had no idea what classes I should be looking for when I was trying to learn it. In any event, I agree that File needs to be expanded to allow for real file manipulation, and that something has to be done to make sense out of all the streams and readers and writers laying around.

    1. Redesign class loading from scratch, this time with human interface factors in mind.

    Class loading, in usual cases, isn't a problem. I suppose it can get tricky when you start fiddling with CLASSPATH and packages and dynamic loading, but I really haven't seen enough problems with this to comment one way or the other. I've never encountered the bug he mentioned about Class A implementing Class B but not being an insatance of Class B because they were handled by different class loaders, but that at least should be fixed.

    There are a few things I would also like to see done with Java:

    • Multiple Inheritance. I know people complaine about complex code, but there are some things that are just so much easier to do with multiple inheritance. The language can and should have rules built in to avoid the diamond problem.
    • Templates. I think this one is being worked on the the JCP. This might be one of the things planned fo rhte 1.5 release; I don't remember.
    • Better Large and Complex numbmer support. BigInteger and BigDecimal should behave like String; classes that can be mainpulated via mathermatical operators. A ComplexNumber class should also be introduced, and behave the same way. This would make the math people happy, and do a lot to qwell the cry for operator overload.
    • Enums. This is mentioned in the article, and is a great idea. There are a few places where you can learn how to get Java to mimic enumerations; you shouldn't have to cludge it in, it should be part of the language.
    • Better process handling. You cannot reliable execute shell scripts form Java, and getting output from/sending output to spawned (native) processes is difficult. This should be changed.
    1. Re:Improving Java by thomas.galvin · · Score: 1

      And one more thing for my wish list: a byte-code to native code complier that ships with the Java SDK. I've got one laying around somewhere, and I don't even use it that much (it's a trial edition, I can't use it for comercial stuff), but it'd be nice to have one ship with javac. HotSpot already does native compilation, so I don't see why they don't give us access to it.

    2. Re:Improving Java by Anonymous Coward · · Score: 0
      Why don't they give you access to it?

      Well... because, except for load time, it's better to have the compiler running with the program instead of running it separate from the program before the program executes.

      Take one random example like branching. Conditional branching can really screw up the performance of a processor in some circumstances. Modern processors have special hardware to track branches and try to predict which way they'll go. If they guess wrong, the entire pipeline has to be flushed (and instructions' effects invalidated). This wastes lots of valuable time.

      So what does that have to do with Java? A code generator can structure code differently for the best performance based on whether the branch is usually taken. Traditional compilers have basically no information about whether a branch's condition will be true or false and have to totally guess what code to generate. But a JVM is different. A JVM can actually watch execution and determine dynamically which code to generate.

      Basically, a JVM has access to valuable information that a traditional compiler doesn't, so a JVM can generate better machine code. (Some traditional compilers even allow you to run a program with profiling turned on, then feed the profiling information back into the optimizer. But this still isn't as good information as what the JVM code generator has, because the profile is done with "fake" data.)

      I'm no expert, but there are surely other optimizations that can be done by a JVM's code generator but not by a traditional compiler. One random idea is that you can examine the class hierarchy and determine that certain classes are actually final (i.e. never extended) even though they're not declared that way. Then, you can perhaps generate code that uses more efficient method invocations (basically, skip the v-table).

    3. Re:Improving Java by thomas.galvin · · Score: 1

      You seem to know what you're talking about; you should grab a /. account somor people will hear you.

      Anyway, I've read some of the papers that indicate run-time compilation can actually outperform pre-compilation by about 10 percent, for the reasons you mention above. I can even logically see why this is the case. Where this all falls apart for me, though, is in my catual experience.

      Now that I think about it, I would imagine that a lot of the problems I experience (and honestly, they aren't that big) come from SWING, not the VM. Although SWING has gotten much better, there is still a feeling of sluggishness about it, much like there was with the first release of Netscape 6. It will, however, continue to get better.

  52. Garbage Collection and Package Versioning by cca93014 · · Score: 1

    What about making garbage collection less of a lottery? I've heard a lot of people complain that certain J2EE servers (that shall remain nameless) can often sit for 30 seconds collecting all the garbage when they should be serving the application.

    Secondly, what about specifying some sort of jar/war/ear wrapper that encrypts the package and adds a pile of meta-data. How often have you looked at a jar and thought "Is that the one I built yesterday or not" ??? In a production environment this can be a big problem. Yes yes I know that configuration management can fix this problem, but if you are picking up a production environment that a just-gone-to-the-wall dotcom was supporting, the chances are you won't have a clue...I hear .net does this, and I think it's a very good idea...

  53. Python by ultrabot · · Score: 0
    there are other languages waiting in the wings written by some very sharp programmers who have learned from Java's mistakes and are eager for the opportunity to replace Java in the same way Java replaced earlier flawed languages.

    ... and we know the language he's talking about. :-)

    --
    Save your wrists today - switch to Dvorak
    1. Re:Python by Anonymous Coward · · Score: 0

      ...do you mean Ruby?

  54. Nitpicking from a professional programmer by _LORAX_ · · Score: 5, Insightful

    10 ) Ok, but what about moving to a better system where you can compile against a specific version. Try to compile agains 1.3 with methods that were depreciated and it will fail.

    9 ) Ok, within the java API the naming convention should be consistant. Outside of the API it's the programmers decesion. To dictate a style of writing would place an undue burden on programmers

    8) No, not on your life. You can take my primitives from my cold dead body. If you want to suggest that primative should not be used in most production applications that's fine, but their is a time and a place for priatives that are very important. Suggesting that we get rid of primatives severly hurts your credability.

    As for your comment about 2b + 2b != 4b... No shit you add two SIGNED 32bit values and expect it to work properly despite the buffer overflow! BigInteger is part of java.math and is a perfedt counterpart to Integer, but can be as big as you want.

    7) Um, mabye. Chars are already expected to represent string and I doubt there would be much resistance to having a JVM decide how big those should be. It's not like he's trying to suggest that short should be changed ( oh... yea ).

    6) I can see some cleanup here. Threadgroups could go away and 99.9% of people would not care. As for the non-atomic nature of 64bit+ primatives that has alwyas been clearly documented in the spec. It does not guarentee atomic operations on anything longer than 32bits. Although this could be changed it was always a trade off between the smaller systems and the larger systems that java would be running on.

    5) No, please, no more bloat. XML is great, but to continue to add LARGER API's with memory hungry requirements to the system is a death sentance.

    4) Smoking the BAD crack. AWT has it's warts and problems, but just look at mozilla on the MAC for all the reasons that native widgets should continue to be supported at all costs. I would not mind an alternate WM/WT as long as it had true native peers so that java can participate as a first class application on all platforms. AWT currently is poorly designed to handle the diffrences between OS's and take advantage of the niceties on some platforms, but that's no reason to abandon native widgets.

    3) Java has two sets of collecations. Ove that was based on 1.1 ( Vector, Hashtable ) and one for Java2 ( List, HashMap ). Anybody that's bothered to read a performace tuning book would realize that the Java2 collection system ( although without generics ) is by far the better system. The Java2 system allows either synchronized or non-synchronized operation. This is because the vast majority of java collection use is internal to a class or method where syncronization just adds a burden to the system. Why use a beartrap for holding your desk pens when a cup would work just as well.

    2) Yes, count me in. The I/O subsystem uner java it totally inoperative for many tasks. A RFE currently pending ( for several years ) is to adda simple way of finding out how much free space is availible on the filesystem. Metadata information is a casulatly of war. It just needs to be tossed out.

    One thing that he doesn't hit on, but it a REQUIREMENT for interoperability is some standardized way of doing fixed block decoding/encoding ( think struct ). It's just amess trying to get complex binary structures into and out of java without going quite mad.

    I don't agree that Streams should be buffered by default as that can CAUSE problems. Buffering should alwyas be under the control of the programer.

    1) Yes, it's already known that the current class loader has some issues, but they are working on a better one. There is no reason to throw the baby out with the bathwater. Many advanced programs are running into problems expecially when they are using custom class loaders.

    But.... he didn't even mention quite a few issues I have personally with my big pet peve being....

    The GC. Many programs need some feedback and some wat to hint or force the GC of specific objects ( since they peer with NATIVE blocks of ( memeory/code) ). It's very important that the programmer be able to programmaticly control SOME operations of the GC subsystem. I'm not asking for malloc/free, but there are some objects that can be a pain to work with and some programming requirements that cannot be achived under the current GC system. It's a black box without any feedback. I would like to be able to tell the GC when I have 10ms where I know the system's time would be better spent cleaning up after itself to go ahead nad do it. I need to be able to force the cleanup of specific classes/instances when they are holding on to native resources.

    Anyways..... I think I've rated enough. I can see where this guy is comming from, but most of his points are whining or ignorace of the system.

    1. Re:Nitpicking from a professional programmer by StrawberryFrog · · Score: 3, Insightful
      No, not on your life. You can take my primitives from my cold dead body. If you want to suggest that primative should not be used in most production applications that's fine, but their is a time and a place for priatives that are very important. Suggesting that we get rid of primatives severly hurts your credability.

      And your reason is? You have of course studied the way that C# does this, keeping both primitive-type-speed and uniform-object-hierarchy uniformity?

      As for your comment about 2b + 2b != 4b... No shit you add two SIGNED 32bit values and expect it to work properly despite the buffer overflow!

      Um, I think that's his point: Bits & buffers & overflows are right for data, addition working properly without the potential for buffer overflows is for integer math. The two are very differnt things.

      --

      My Karma: ran over your Dogma
      StrawberryFrog

    2. Re:Nitpicking from a professional programmer by Anonymous Coward · · Score: 0

      As for your comment about 2b + 2b != 4b... No shit you add two SIGNED 32bit values and expect it to work properly despite the buffer overflow! BigInteger is part of java.math and is a perfedt counterpart to Integer, but can be as big as you want. Speaking of credibility, I stopped reading your post after the above line. If you don't know the difference between a buffer overflow and an arithmetic overflow, I have a hard time taking your opinions on language design seriously.

    3. Re:Nitpicking from a professional programmer by diablovision · · Score: 1

      9 ) Ok, within the java API the naming convention should be consistant. Outside of the API it's the programmers decesion. To dictate a style of writing would place an undue burden on programmers.

      Bah. It's an "undue" burden to name something correctly. I work with several Polish/German/Swiss programmers. Let me tell you, a naming convention is damn important!

      8) No, not on your life. You can take my primitives from my cold dead body. If you want to suggest that primative should not be used in most production applications that's fine, but their is a time and a place for priatives that are very important. Suggesting that we get rid of primatives severly hurts your credability.

      Agree completely. Trying to force numerical and scientific applications to be object-oriented with their arithmetic is nonsense.

      6) I can see some cleanup here. Threadgroups could go away and 99.9% of people would not care. As for the non-atomic nature of 64bit+ primatives that has alwyas been clearly documented in the spec. It does not guarentee atomic operations on anything longer than 32bits. Although this could be changed it was always a trade off between the smaller systems and the larger systems that java would be running on.

      Running java on a machine with a looser memory model is a good way to find out how difficult it is for the language and VM to guarantee memory semantics. Several people, including Doug Lea, have worked on specifying what Java can guarantee. It boils down to things like double-check locking and hand-coded synchronization methods like Dekker's algorithm can't be guaranteed on machines with loose memory models.

      5) No, please, no more bloat. XML is great, but to continue to add LARGER API's with memory hungry requirements to the system is a death sentance.

      I agree. Java bytecodes are stack based for a reason: they are very compactly encoded. A textual representation could easily be 5x as big. The other reason is that the set of bytecode programs that javac can produce is much smaller than the set of bytecode programs that one can construct by hand--even correctly dynamically typed programs. Most VMs make assumptions about the bytecode structure and will fail to verify code that is oddly constructed. Similarly, the set of statically verifiable programs is not equivalent to either. Having a human readable (and editable) format is asking for trouble, as many people will run into problems with the bytecode verifier with amazingly obscure reasons.

      The GC. Many programs need some feedback...

      There is a System.gc() call that is supposed to yield the current thread for garbage collection, but there is no guarantee that the system will actually perform garbage collection. IMHO, I think control over the garbage collector is going to do nothing but make implementing a GC algorithm more complicated and less efficient. Besides, the particular GC algorithm employed in the VM you are running on is beyond your control. There are dozens of different possibilities with different performance and overhead requirements. A user program could not control the algorithm as efficiently as possible if it doesn't even know with algorithm is implemented.

      --
      120 characters isn't enough to explain it.
    4. Re:Nitpicking from a professional programmer by bnenning · · Score: 3, Insightful
      Suggesting that we get rid of primatives severly hurts your credability.

      (Must...resist...spelling...comment.) Why? Using primitives with objects (especially colllections) is ugly, inconvenient, and inefficient. If properly done, speed won't suffer and you'll continue to use operators on int and float "objects". Much as it pains me to say it, C# does this right.

      BigInteger is part of java.math and is a perfedt counterpart to Integer, but can be as big as you want.

      Right, and if primitives and objects were merged it would be much easier to use BigInteger and BigDecimal, since you could use standard operators instead of clunky methods, i.e. "bignum += 2" vs bignum = bignum.add(new BigInteger("2")).

      I can see where this guy is comming from, but most of his points are whining or ignorace of the system.

      XML is great, but to continue to add LARGER API's with memory hungry requirements to the system is a death sentance.

      Huh? He's talking about using XML as the serialization format instead of the current binary format. It doesn't change the API at all, nor add bloat. Text formats are almost always better than binary, and as the author points out, it may actually improve performance.

      I can see where this guy is comming from, but most of his points are whining or ignorace of the system.

      I guarantee that "this guy" knows far more about Java than you.

      --
      How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
    5. Re:Nitpicking from a professional programmer by pHDNgell · · Score: 2, Insightful
      8) No, not on your life. You can take my primitives from my cold dead body. If you want to suggest that primative should not be used in most production applications that's fine, but their is a time and a place for priatives that are very important. Suggesting that we get rid of primatives severly hurts your credability.

      There's no reason to tie such things together. Primitives are a design flaw in the java language (not the VM). There is no reason to have a distinction between the primitive int and the Integer object. A reasonable compiler should be able to see how the variable is being used and do the right thing. See Eiffel. In Eiffel, everything is an object, yet performance is amazing.

      --
      -- The world is watching America, and America is watching TV.
    6. Re:Nitpicking from a professional programmer by p3d0 · · Score: 2
      Suggesting that we get rid of primatives severly hurts your credability.
      Ad-hominem arguments hurt your credibility more. He posted lots of fairly convincing reasons that primitives are not necessary. Do you have any actual reasons for thinking they are?
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    7. Re:Nitpicking from a professional programmer by Anonymous Coward · · Score: 0

      Trying to force numerical and scientific applications to be object-oriented with their arithmetic is nonsense.

      Nobody is trying to force object-orientation into numerical or scientific applications. It is simply a matter of cleaning up the type system. You can continue to write normal code with ints and doubles and let the compiler take care of optimizing the code. As has been mentioned numerous times already in this thread, C# and Eiffel already do this to great effect.

      I agree. Java bytecodes are stack based for a reason: they are very compactly encoded. A textual representation could easily be 5x as big.

      Ummm, the article talked about XML encoding for object serialization, not Java bytecode. I don't believe that XML is even a good choice for that, however.

  55. Top ten reasons we need Java 3 by selectspec · · Score: 5, Funny

    10. Java 2 isn't big enough.

    9. Cool 3D-glasses marketing gimick potential

    8. We can all complain more when MS doesn't support it.

    7. Library need another complete overhaul of the GUI classes.

    6. Add in all of the C/C++ features that we're left out.

    5. O'Rielly can sell another series of books (how about a fungus?).

    4. Since all of the people who know Java 2 are unemployed, this project will keep them off the streets and out of trouble.

    3. Java doesn't have enough incompatibility issues as it is. We need to level the playing field.

    2. 'Cause the alternative is caving in to C#.

    1. Emacs is better than vi.

    --

    Someone you trust is one of us.

    1. Re:Top ten reasons we need Java 3 by tomhudson · · Score: 3, Funny
      And reason number 11 - so that all the java programmers can finally get fed up, switch back to C/C++, and learn how to use malloc, pointers, and free properly!

      Seriously, lt's not cave in to C!so#

    2. Re:Top ten reasons we need Java 3 by CynicTheHedgehog · · Score: 2
      4. Since all of the people who know Java 2 are unemployed, this project will keep them off the streets and out of trouble.
      I know the parent post was meant as a joke, but I'd just like the point something out.

      A coworker of mine came across an article in some trade magazine that said demand for Java developers is actually on the rise...something like 11% annually. And no, I can't back that up with a reference--it was just something mentioned in passing. But the evidence supports it--Java is actually huge in the enterprise server market. Java-based J2EE application servers sell for $15,000/CPU, industrial sized applications like MetaSolv Solution go for thousands per seat, annually, and it seems as if both IBM and Oracle threw their respective lots in with Java a long time ago.

      Considering that all of thise software runs at the heart of many corporations, and that it's something they can't scale back, it seems like there's plenty of money (i.e. employment opportunities) in Java.
    3. Re:Top ten reasons we need Java 3 by humboldt · · Score: 2, Insightful

      1. Emacs is better than vi.

      You almost had me until that...

    4. Re:Top ten reasons we need Java 3 by scrytch · · Score: 2

      And reason number 11 - so that all the java programmers can finally get fed up, switch back to C/C++, and learn how to use malloc, pointers, and free properly!

      malloc? wuss. real men use sbrk()

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
  56. once burned... by dankelley · · Score: 1

    I wonder whether encouraging people to switch to an incompatible java3 will just convince them to jump ship?

    A few years back I made some java-based webpages for a science course I teach. I had been interested in the language, and this little (few 100 lines) application seemed just right for a test case. So, I took some cgibin code and started rewriting. The results were fine, in the end, and I thought that my time had been justified.

    The next year I wanted to add something new to the code. Whoa. My old code no longer compiled, given java function renaming.

    That was enough to turn me off Java. In several decades of programming (assembler, fortran, algol, PL/1, C, C++, ...) I've never had code written in one year fail in the next.

    I've been told that I was just being caught in the "early adopters" disease, and that java now has now stopped making incompatible changes.

    And then I read this /. thread. Oh my.

    1. Re:once burned... by the+eric+conspiracy · · Score: 3, Insightful

      In several decades of programming (assembler, fortran, algol, PL/1, C, C++, ...) I've never had code written in one year fail in the next.

      You must not have done much work in C++ or C. The K&R C to ANSI C transition broke many of my programs, and C++, well, all I can say is that I remember having to make changes to my C++ code almost every time a new compiler version was introduced in the early 90's.

    2. Re:once burned... by renoX · · Score: 2

      > The K&R C to ANSI C transition broke many of my programs

      Uh? Many compilers had a switch which allows you to stay in compatibility mode in K&R.
      -> No need to modify the programs.

      As for the C++, there are some compatibility modes but I'm not surprise that you still had to make modifications: this language is really messy.

    3. Re:once burned... by jbolden · · Score: 1

      At the time the Ansi standards came out most compilers had good support for both K&R C and ANSI C. I'm fairly sure most still do. You could throw the switch function by function, file by file...

    4. Re:once burned... by Anonymous Coward · · Score: 0

      The next year I wanted to add something new to the code. Whoa. My old code no longer compiled, given java function renaming.

      What are you talking about? Java is has been religious about backwards compatibility and still fully supports all those "deprecated" methods.

      And then I read this /. thread. Oh my.

      Oh my, a tech writer has suggested making an incompatible language change. Clearly, the world's legacy Java code is doomed.

  57. The dumbing down of programmers by Anonymous Coward · · Score: 0

    Java, VB and Windows is responsible for a whole lot of crappy systems out there. The more you spoon feed them, the more I-want-to-be-a-programmer-because-tech-is-a-good-c areer-option guys start writing code. And crappy code. I suggest everybody just sticks to UNIX and C :-)

    1. Re:The dumbing down of programmers by Anonymous Coward · · Score: 1, Insightful
      what about the factors like: I-am-1337-and-thus-refuse-to-accept-any-possible-n otion-of-progress-because-I-know-it-all

      it is true that there has been a horrible lack of discipline. Many times not just with IT or technology in general, adversity and difficulty beget innovative solutions. However, when it becomes 'easy' then people get lazy. Complacense is rarely if ever good.

      There are many out there that enjoy the 'career' of IT because they genuinely like it. If they have bad habits it is not correct to judge that they have them because of lack of trying. perhaps if instead of hacking, people would then PLAN systems? What follows is; instead of just throwing languages out, perhaps people could teach proper methods, provide standards and actually have the discipline to interoperate and provide modular extensions to apps and services instead of creating thousands of little craplets that don't mesh.

      offtopic now, but if the next time you see a gap in features or 'look' then please consider adding to existing projects. At the very least, please consider the very real (as in real life USE) situation that many will eventually want to use said app WITH others.

  58. Stack by Anonymous Coward · · Score: 0

    Stack-based bytecodes are fairly trivial to map to registers (google "register coloring algorithm"). Stack-based opcodes are a compromise for all the register-deficient machines out there (see x86). There are dozens of papers on the subject of mapping stack slots to registers.
    I do agree with your point about most of the grievances about Java are library related. This is easily fixed by comparison to the design problems in the JVM itself: such as not having a proper data section in the class file format (look at the bytecode for array initialization sometime), or not having versioned jar files or opcodes that can run pointer-based operations in order to support languages like C. The JVM is not a great universal virtual machine for all computer languages. It is too Java-centric (no tail-recursion optimization for Lisp, no pointers for C, no continuation support).

  59. Biggest plus of the article by f00zbll · · Score: 1
    The fact that java expert are free to criticize and influence the direction of Java is one of the most attractive part of the language for me. Look at NBIO in jdk 1.4.0. From my understanding, it came about because others outside of Sun saw a need and pushed for it. Now it exists and is part of jdk1.4. If we take the statement "no language is perfect" to be true, the article does make some compelling arguments.

    Sure people are going to disagree over what is more important, but the fact these discussions occur in the expert groups regularly shows the community is open. Reguardless of who or what company invented the language, the more important thing is it include a process by which the community can drive its direction. Balancing the needs of all the users isn't an easy task and in most cases if much harder than writing the code.

    1. Re:Biggest plus of the article by Anonymous Coward · · Score: 0

      It took over 5 years for Sun to add NBIO to Java.
      The Java Community Process simply does not work.
      Most bugs are falsely re-branded as "enhancements".
      A simple select() statement and a non-blocking read() and write() could TRIVIALLY have been added to the java Socket class years ago instead of all this NBIO bloat.
      The Java changes are driven by their big paying customers.
      Most of the Java vendors do not wish to change so they stall acceptance of new features as long as possible.
      Too little, too late. Sun should hand over Java to an open standards body - or better yet - hand it over to the Apache group.
      Apache gets great results in a timely fashion and follow a truly open development process.

    2. Re:Biggest plus of the article by f00zbll · · Score: 1
      It took over 5 years for Sun to add NBIO to Java. The Java Community Process simply does not work.

      would you prefer a system with no community process? Like I said, managing people's desires is much harder than making the code changes. Sure the JCP might need better managers, but I'd much rather work to improve it than just say it sucks or that it doesn't work. There's plenty of flaws in the JCP process, but atleast there is one. It's up to the community to make it known to Sun what are the most important issues. Have you ever participated and sent in comments? It's a lot like voting right. You get out of it what you put into it.

    3. Re:Biggest plus of the article by Anonymous Coward · · Score: 0

      Voting in the JCP is completely useless. Bugs are commonly wrongly reassigned to be "feature requests" at the whim of some nameless idiot in the Java Bug Parade complete with some pompous diatribe about language purity. "Language Purity" is Sun's short form for "we're too lazy/stupid to implement or fix this."

      Patches are all that matter. Apache has the correct model of development: public CVS, bugs are fixed often the same day they are discovered, true design debate with tangable concrete results in the form of code.

      Sun has the wrong model: a slow and lumbering commitee with code and designs imposed on us every 1.5 years instead of discussed with us.

      But what do you expect? Java is not an open standard, but a proprietary product of Sun Micro.

  60. Kill the classloader by blackcoot · · Score: 1

    Of all the suggestions in the article, this is the one I liked the most --- I've been paying some thought to this idea in general (i.e. not just Java classes, but anything that requires the notion of linking against libraries). I think what needs to happen is that something conceptually equivalent to a version control system for libraries be built, with a central master repository containing the "official" version(s) of things and per developer sub-repositories containing the latest versions of whichever libraries the developer was working on. As changes get committed into the main source tree, a periodic build process could be used to keep the main repository synchronized. Now linking becomes a fairly trivial matter --- the class loader checks the developer's personal repository first and then the master repository, favoring newer and developer versions of objects in its resolution. Now for the fun (and possibly less than useful) bit --- teach the classloaders how to talk to each other, creating a shared cache of those libraries used most often. This approach does have several major holes in it, not the least of which is how to deal with versioning, but I am all for trying anything that doesn't involve the current classloading scheme.

  61. Why not just drop the depricated... by zenyu · · Score: 2

    I can't agree with the dropping of primative types, since they are just so darn useful for graphics programming. But I wouldn't mind if the methods first depricated in JDK1.2 (Java 2, right?) were eliminated in Java 3. It would require a little bit of fixing for me, since I've used them for backward compatibility, but only an hour or two per program.

    Dropping the original IO or AWT would suck because at times they are 10x faster than the newer equivalents. I learned that by porting, then screaming, then unporting. I wouldn't mind if AWT and the original IO were lost in Java 4, after being depricated when Java 3 is introduced. Then we can push for the performance and completeness increases in those before we have to use them, perhaps by carefully refactoring the newer stuff not to depend on the old, nativizing some things, etc. So a JColor would be introduced for instance. The new io is too complex, but it is the complex we know ;P

    Porting code to a new languange is no small thing. I'd rather port to C++ if the effort is that large, it has become a lot more standards compliant in the last 7 years...

    I know people that complained Java 1.3 wasn't backward compatible enough because of how it treated anonymous packages. I can see those ppl switching to C#.

  62. java ? by Anonymous Coward · · Score: 0

    people still program JAVA ?

  63. hmmm by Anonymous Coward · · Score: 0

    Java is not better than C++. It may be easier for you to write your particular web-based business application, but that does not make it better in general, per se. Show me a good word processor and spreadsheet with all the functionality of MS Word and Excel written in Java. Show me a good browser written in Java comparable in feature set to Mozilla or IE. Show me a robust operating system written in Java. Just because you are not competent in C++ does not mean it is inferior to Java.

    1. Re:hmmm by Twylite · · Score: 2

      RTFS (statement):

      to a lot of people, is a damn sight better than C++

      There is a domain of usage suitable for any given language. To a lot of people, Java is far better than C++ in the domain in which they work. You even acknowledge this.

      Java cannot be applied to operating systems because it does not have the syntax or functionality to control hardware with the required precision. Java recognises that by providing JNI.

      Office suites and web browsers represent a huge amount of code investment - something only one company (Corel) has been willing to risk given the infancy of Java at the time. Were MS, Corel, Lotus etc to start on a level playing field right now, with all their knowledge, and expertise in the language of their choice, but no existing code base, the choice of technology (out of C++ or Java) would be a very interesting question; but my bets would be on Java to deliver a robust solution in a shorter time. The primary factors holding Java back for these applications are the performance issues in Swing, and the poor integration with the platform look and feel.

      Just because you are not competent in C++ does not mean it is inferior to Java

      Actually, this is CONTRARY to a basic rule of software engineering, which is that the best tool for the job is the one you know. No team can deliver a robust, quality solution based on a platform with which it is not familiar.

      That said, I am an experienced C++ and Java programmer (amongst others), and work extensively with cross-platform products in both languages. Each has their place, but for every application where the requirement for stability has outweighed the requirement for speed, I have found Java the correct solution.

      Even where speed has been a tantramount consideration, there has been a cost benefit in using a Java implementation (shorter development cycle and quicker time to market versus more expensive hardware).

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    2. Re:hmmm by croanon · · Score: 1

      http://www.thinkfree.com/

      --
      Dear Bill, do you have a .net tatoo on your ass for marketing?
    3. Re:hmmm by Ayende+Rahien · · Score: 1

      a> I believe it'll be C#, as MS is supposedly moving their application development to C#.
      b> IIRC, Netscape tried to move large portions of their browser to Java, that made a lot of bussiness sense considerring that they had so many platform to support. They pulled that back after having a lot of problems.
      c> Off-handedly, I can't recall any feature of C++ that makes it closer to the hardware than Java (the language, not the platform). Is there a concerate reason why Java can't be used to build a kernel? Of course you would need to provide a delete/free(), because GC inside a kernel is *very* bad idea. but aside from that?

      --

      --
      Two witches watched two watches.
      Which witch watched which watch?
    4. Re:hmmm by Twylite · · Score: 2

      Java has no assembler level instructions to do port IO. It also doesn't provide you with direct memory access - which goes beyond alloc/free as you need to control the descriptor tables which define memory protection. Then you have the problem of handling interrupts (not only hooking them, but masking and unmasking, which on most architectures as CPU instructions), etc.

      Without JNI, you can't hope to achieve any of this. C/C++ allows you to "drop down" to asm at any point, in such a way that the asm is compiled into the final object code. Java has no such functionality.

      It *may* be theoretically possible to create a Java kernel on a system built specifically for that purpose - by allowing hardware control (IO, memory protection, interrupts) via memory mapping; but I still think you'll find you need to run a microcode interpretter on the CPU to handle garbage collection (amongst others), and a class to provide direct memory access to the mapped regions -- neither of which could be expressed in "pure" Java.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  64. Exactly! by croanon · · Score: 1

    I am happy to see someone else has this logical view! :)
    JVM is the most important. It must run beautifully!

    --
    Dear Bill, do you have a .net tatoo on your ass for marketing?
  65. Ugh. I Disagree. by dasmegabyte · · Score: 2

    Normally, when somebody says "Upgrade Java," I wholeheartedly agree. But what Harold (a good writer, two of his books sit on my desk falling apart) suggests is in many ways just foolish.

    Removing deprecated methods may seem like a good idea, but a lot of the deprecated methods, Thread.stop() especially, are essential parachutes. If a thread stops responding in a manner that's untestable, or if it's within an anonymous class, you need that method...deprecated, dangerous or not. Similarly, making the language more long winded does not really help us. The appreviations in java can be counted on two hands, and they're all things we use pretty often. What's next, extending String.valueOf() to UnicodeTextualString.returnTheValueOfThisInteger() ?

    Primitive types are nice to have around because they optimize sweetly and can be trusted as the the fastest part of an app. Relying on machine speed to clean up the bloat of using too many objects is what's going to make CLR kill Java in the benchmarks (that I guess we're technically not supposed to do anymore).

    Ditching the AWT means ditching all browser support. NO! Furthermore, XML is not the darling of the planet that it purports to be. I like my tiny, efficient serialized objects; easily compressed and not very human readable. I don't want to conv to Base64 and serialize to XML. Why burn those extra cycles just for some ostensible "human readability" when no humans will ever need to read it other than those of us who understand deserialization?

    There are so many things broken with java -- complexity of class structures, taglibs, the inconvenience of formatting and calendar classes, EJBs, stupid JDBC bugs -- I find it troublesome that Harold's biggest issue is the spelling of InetAddress. He knows damn well why it can't be InternetAddress...that's used in javax.mail.internet for a totally different task! He wrote the damn book that taught me that package!

    --
    Hey freaks: now you're ju
  66. Re:Not the answer by NorthDude · · Score: 1

    This design pattern is called Composition and gives you the same exact result.
    No, it is not multiple inheritance, but you won't have m-i in java.

    And why exactly would it not work?
    Beside the fact that the syntax is not like you would like it to be? (no flame intended, just a question)

    --


    I'd rather be sailing...
  67. 10 reasons for Java 3? by Jonsey · · Score: 1

    I thought there was only one reason we needed Java 3: Three Times The Caffiene

    --
    I assert that my comment is only my opinion, not that of any employer, past, present or future.
  68. We already have Java 3 and its VM by News+for+nerds · · Score: 1, Troll

    C# and CLR

  69. I strongly disagree. by croanon · · Score: 1

    MI, Operator Overloading and Pointers mustn't be added to the Java.
    -MI does not exist in nature. It is cheating to abstract some entities in an easier way. It simply does not work except for several cases.
    -You can do everything you can do with Operator Overloading without using Operator Overloading. It certainly helps to reduce the syntax complexity of numerical applications, but, generally easy to abuse, or misuse by creating wrong semantical correlations. There are many cases, in which the "addition" operator for some entity may be defined with more than one semantics. In big projects, it leads to confusion, and hard to determine bugs. I had a problem with them, I know. Much better to not to have it.
    -Once pointers enter into a language, expect memory leaks, dangling pointer bugs etc. By the way, on virtual machine based systems, you cannot implement dynamic languages, which contains pointers, and memory access.

    --
    Dear Bill, do you have a .net tatoo on your ass for marketing?
    1. Re:I strongly disagree. by SnapShot · · Score: 2, Funny
      MI does not exist in nature
      Oh sure, tell that to Mom and Dad.
      --
      Waltz, nymph, for quick jigs vex Bud.
    2. Re:I strongly disagree. by croanon · · Score: 1

      Hahahahaha! Perfect! Really thanks for that! :)
      But don't forget that people with two heads do not live much. You know. :)
      It is not multiple inheritance, but selective one.

      --
      Dear Bill, do you have a .net tatoo on your ass for marketing?
    3. Re:I strongly disagree. by Anonymous Coward · · Score: 0

      well, you can do everything in assembler too... doesn;'t mean its easier or desirable thing to do.
      operator overloading is a wonderful thing, it makes OO work IMHO by allowing you to work on types in exactly the same way. Sure, they'll do different things (ie when you call (int) i+1 will be different to (string) s+1).

      You had a problem with it once... well, perhaps you should program for a few years before making statements about what is good or bad in a language.

  70. Multiprocess JVMs by rasilon · · Score: 1

    The point is not that the JVM uses multiple processes, rather that the JVM may run multiple processes. ie. the ability for the same JVM to run (say) jbash and jls simultaneously. Thus you need one JVM per user, or per system. The apple shared memory approach goes a long way towards this, but externalises the memory and process isolation whereas a pure multi-process JVM would internalise them.

  71. Java's problems by shish · · Score: 1

    The java 1.4 vm runs 1.0 1.1 1.2 and 1.3 code, the 1.2 vm even runs 1.3 code! The bytecodes are not the problem, even a major change can be picked up by version number in the class file and a different vm called, it's the heavily bloated libraries that make java slow.

    Using JIT, java is compiled to the optimal native code for any platform, thus making it (sometimes) faster than C code compiled for compatability on many processors. The problem is that the unused deprecated methods take time to compile from bytecode to native code, so each time a new object is created, it takes ages before it can be used.

    Also all the unused methods take up RAM, with java's bloat memory is used up very quickly

    As to getting rid of primitive types, think of RAM again! a byte primitive takes up a byte of ram, but a byte object (like java.lang.Byte) takes up the byte of it's value plus all the methods.

    I think java 3 should screw compatability and just cut out all the deprecated/rarely used methods, thus making it faster and more portable (rt.jar - the core java library - is 22meg, but a fair chunk of it is never used, think of all the 56k AOLers!)

    --
    I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
  72. Java and Learning from the .NET CLR by benjfowler · · Score: 2, Insightful
    As both a Java and C# coder, I'd like to comment on two of the points raised in the article: primitive types as classes, and the class loading mechanism.

    ERH makes some excellent points in the article, which happens to touch on a couple of issues I've felt is mediocre in Java, but moderately cool in the .NET Common Language Runtime - things that could do well in being transplanted into the Java language and runtime.

    The .NET CLR, being a relatively recent creation has naturally gotten the benefit of 20-20 hindsight. Two area that it seems to do better than Java is of course, class versioning/loading and the issue of primitive types in Java.

    For those of you who aren't familiar with C#, it implements it's primitive types as "value types" (as opposed to the familiar reference types we know and love from both Java and C#). Value types are passed by value (but can be boxed if you need to take a reference to an instance of a value type). The .NET CLR type system imposes some restrictions on what you can do with value types (I can't remember what they are offhand, sorry), but they enable value type instances to take up a very little space, making them virtually as efficient (time and space wise) as the "atomic" primitive types currently in Java. Would the introduction of primitive types as classes be so inefficient as other posters are claiming. I think not.

    In the .NET CLR, you don't have no bloody CLASSPATH, but you do have two types of assemblies (private and shared), assembly probing (standard "protocol" for searching for dependancies of a given module), a powerful way of tweaking module loading through user-written configuration files, and a neat versioning model.

    I highly recommend all haters of Java's class loading mechanism take a look at how the Microsoft people have done it. This is seriously good work.

    MSDN: How the Runtime Locates Assemblies

  73. AWT!=Advanced Windowing Toolkit by Phil+John · · Score: 1

    Sorry...just need to clear something up...AWT stands for Abstract Windowing Toolkit, not Advanced as you seem to make out...just thought I'd clear that up.

    Personally I want the AWT to stay, at least for the time being. I sell a chat solution that uses a Java applet...with my own lightweight components, many people would have to download the java plugin to get swing and this is frowned upon by the kind of sites I work for...the customer shouldn't have to download anything at all to get it to work...it should just..."work". :o) oh...the fun I have!

    --
    I am NaN
    1. Re:AWT!=Advanced Windowing Toolkit by thomas.galvin · · Score: 1

      Sorry...just need to clear something up...AWT stands for Abstract Windowing Toolkit, not Advanced as you seem to make out...just thought I'd clear that up.

      Hmm..well I'll be. You're right. Been a while since I've looked. :-/ Good catch.

    2. Re:AWT!=Advanced Windowing Toolkit by jedi_programmer · · Score: 1

      I always thought it stood for Awful Windowing Toolkit =)

  74. True... by artemis67 · · Score: 4, Insightful

    Microsoft would like nothing better than for Sun to release a version of Java that isn't backwards compatible. That would give them two options:

    1) Stick with the old Java 2 VM for a really really really long time, claiming backwards compatibility, and watch Sun fall on its face, or

    2) Upgrade to Java 3 immediately and watch everything break.

    Either way they obey the letter of the law, and it gives MS an opportunity to really push C# as developers get frustrated with the transition.

    1. Re:True... by pmz · · Score: 2

      Microsoft would like nothing better than for Sun to release a version of Java that isn't backwards compatible.

      Don't forget that Sun offers directly from their home page the current Java Runtime for Microsoft Windows. Just because Microsoft doesn't ship a current version of Java doesn't mean that Java is any worse off for it.

      If Sun decides to make something like this proposed Java 3, they will simply make it available for Windows just as they do for Solaris and Linux. Also, Sun will obviously provide support for several years for Java 2, just as they do for their other products, such as Solaris, that go through transitions.

    2. Re:True... by Yuan-Lung · · Score: 1

      I was working on the development of a community site that has a java-based chat room. My successor implemented the chat room in swing, and posted up a note at the site entrance giving the users the instruction and link to download and install Java 2 run time enviroment. He was hoping that the users could follow the 3 lines of instruction that basically said "click here to download, then run the file after download finishes". However, instead of appreciation for his new and spiffy swing chat room, most users sent complains saying that the chat room is 'broken'. They just ignored the notice on the way in. After talking to some of them we learned that they only had a vague recognition of "java the web thingy", and were insisting that they had it in their IE. The last I have heard was that the next version of the chat room was going back to awt so it will run in IE without needing the user to installing JRE. I guess what I have learned from this is that the majority of the users are technically inept and can't follow the simplest instruction, therefore if something isn't supported in IE natively, you lose these users. While this may not be a concren for some, it is a critical issue with development projects with the average mass as their targeted users.

    3. Re:True... by Jhan · · Score: 1

      [MS response to Java3] 1) Stick with the old Java 2 VM for a really really really long time

      Hello?? MS Java is 1.1 (and was removed entirely for XP?), and has been so for a really really really long time. Sun and IBM produce the only good Java 2 VM's for Windows.

      --

      I choose to remain celibate, like my father and his father before him.

    4. Re:True... by jbolden · · Score: 1

      Have you considered the instructions not the webpage were the problem? Did the users even see the page? Did they understand that the page applied to them. How about something like this:

      1 - The system knows based on a cookie if this is your first time. If its not your first time you go direct to the chat.

      2- If its your first time it checks the version of Java you are using on your I.E. If it the correct version it gives you a cookie and off you go the chat. If its not the correct version it then gives you a direct link to the JRE and opens up additional instructions/FAQ in a seperate window (so the person understands what went wrong).

      People may not notice 3 lines they will notice their browser window resizing into 2 side by side windows with a clear error message and discussion about the JRE. Telling the users they have the wrong Java VM and what to do about it makes it easy for them. Users aren't idiots they are inexperienced, there is a big difference.

    5. Re:True... by Darth_Burrito · · Score: 1

      The JRE is too big to require modem users to download so they can access a chat room. If you want to do things the swing way, maybe you could have two different interfaces to the same chat room. You could even abandon the awt code if you wanted, only adding features to the swing side. That would provide your users with a gradually increasing incentive to upgrade to the latest JRE without cutting them off.

    6. Re:True... by Yuan-Lung · · Score: 1

      Well... this is kinda a none-issue here. At the client's request, the site is geared towards users with high-end machines and fast connections. The site is chulked full of graphics that will just kill someone with a modem connection. The site even has a flash front page that contains movie and music.

      I am not proud of it, but sometimes you just gotta give the clients what they ask for.

  75. Ten Reasons to re-write Java by Anonymous Coward · · Score: 0
    1. Perl is still gaining market share
    2. Python is now a serious competitor
    3. Ruby is turning out to be quite serious
    4. Squeak (small talk) hasn't died
    5. Scheme is stronger than ever
    6. Parrot VM (perl6) is on the way...
    7. There will be a Python compiler to ParrotCode
    8. There will be a Ruby compiler for ParrotCode
    9. There may be a Squeak compiler for ParrotCode
    10. There will be a Scheme compiler for ParrotCode
  76. Talk to the gcc folks by grendelkhan · · Score: 2

    Isn't this what keeps happening with sucessive versions of gcc? We're already seeing binary issues with 3.1.x and 3.2 compiled programs, if Linux users are expected to suck it up, what's the difference?

    --
    Wu-Tang Name: Half-Cut Skeleton Get your own Wu-Na
    1. Re:Talk to the gcc folks by RupW · · Score: 1

      Isn't this what keeps happening with sucessive versions of gcc? We're already seeing binary issues with 3.1.x and 3.2 compiled programs.

      Only in C++ programs (and C++-compiled runtime libraries, such as libgcj). This is because there were bugs/omissions in the C++ ABI which they couldn't fix in a compatible way. They're not breaking compatibility for the sake of it.

      The only plain C per-version issue is the libgcc interface but I think they've largely stabilised that now.

      You're not likely to have both 3.1.x and (the not yet released) 3.2 on a (GNU/)Linux system anyway unless you've got a build-from-source distribution - and in that case you can just rebuild everything with 3.2 and be happy.

  77. point by point by Anonymous Coward · · Score: 0

    First, I admit that Java is very cluttered. It was developed over a decade by hundreds of people at different times with different ideas.

    >10. Delete all deprecated methods, fields, classes, and interfaces.
    ok
    but I will point out the gains are asymmetric.
    Neat freaks have less 'cluttered' reference docs but some companies and programmers will have to rewrite their applications costing many, many man hours and dollars.

    Maybe a better way would be make a versioned class interface, sort of the way COM does it.

    >9. Fix incorrect naming conventions.
    ditto

    >8. Eliminate primitive data types

    >This will undoubtedly be my most controversial proposal
    It makes steam shoots from my ears like Elmer Fudd.

    >computers are a lot faster and have a lot more memory than they used to
    And I use it all! The cycles are mine! all mine...I am not giving back any just so the docs are shorter.

    >Java would finally become a pure object-oriented language.
    I am sick of Smalltalk fanatics raving how this or that is not 'pure' OO. Language Purity is like Communism, a utopian ideal that winds up causing mass destruction in its blind wholesale application because it does not work 100% in the real world.

    >I simply want to make them full objects
    Primitives as objects would at least double the amount of memory because the JVM would need the object reference as well as the value.

    >Just as the statement String s ="Hello" creates a new String object,
    >so too would int i = 23 create a new int object
    This would increase the work of the garbage collector by a giant factor. Memory burn is a serious problem

    int search( ) {
    int i;
    for( i=0; ione integer type that is not bounded in size, and perhaps it should be the default type

    So basically we would have to do all math in software which is like 10X slower. That is what BigInteger and BigDecimal are for. They are rarely used because most applications will take the performance for the trade off of living within a primitive type data range.

    This would also cut I/O speed in half because of the overhead of object construction.

    The only place where this has any merit is the container classes. Primitive wrappers are a pain in the butt. Don't change the primitives, change the containers. There are only about a dozen of them. Rewrite them so that they can accept primitives as well as objects. I have several containers (BTrees, Quadratic Hash) I have written that do just that. It is not very hard to make it deal with a bunch of types rather then just Object.

    >7. Extend chars to four bytes.

    Only if the JVM can use a compressed 1 byte representation on the fly.
    I am not compelled by the idea of being able to have musical notes in strings.

    >6. Fix threads
    Other then removing the deprecated methods, they seem alright.

    >If these types aren't made into objects, then they need to be as atomic as the other single-byte types.
    If your code relies on these operations to be atomic, no wonder you have problems with threads.

    > (a single) object can have multiple monitors for different operations
    This sounds like bad class design in need of refactoring. If the different operations truely did not interact and could have seperate monitors, you probably should split up that class. Anyway, it would be very easy to make several guard object members and synchronized on each one rather then on the implicit this.

    This would be very hard to do and not buy you much.

    > 5. Convert file formats to XML.

    Ok.
    but a lot of work for Sun for only a small gain.

    > 4. Ditch the AWT.

    Painful but probably a good idea.

    > 3. Rationalize the collections
    Ok

    As I said in 7 collections should accept primitive types.

    We also need parameterized types built into the language. Putting and object into a container and then casting it back to the correct type is a lurking time bomb. During run time you can get an exception. It is donkey work that the compiler should do for you at compile time. This was promised for Java 1.4 but got pushed back.

    >2. Redesign I/O
    sigh. Like AWT, IO is a mess (and too slow). It changes with every release so at least Sun is working on it.

    > 1. Redesign class loading from scratch, this time with human interface factors in mind.

    Yes! problems with the class path is the one of the most common problems people have.
    Maybe a 'java registry'? Maybe make a bootstrap executable with all the class path information?

  78. Solution to the inherent loading problems by Anonymous Coward · · Score: 0

    To the class loader and loading speed problem problem and its solution. It is rather easy and has existed before smalltalk. The solution is memory images. Smalltalk had this for ages with the result that those apps start in an instant and no classpath was needed ever. The problem with Java apps is not the startup time of the VM (about one second if at all). It is the tedious class loading class verifiying mechanism, add to that a non existent binary resource handler and you end up with 10 seconds startup time where 9 seconds are used for class loading verifiying and image loading for pictured buttons). Sure the class loading mechanism made sense in the early days when class files in applets were referenced directly since the evolution towards jar files it doesnt make sense at all. Id say ditch the jar files and movie to real binary images like Smalltalk and C# has. (Smalltalk had that for ages, dont they call this image generation, seal off?)

  79. SWT by DigitalDragon · · Score: 2, Insightful

    May I suggest to include SWT into next release, this GUI implementation is far more superior than Swing, much cleaner and faster. For more information please go to: www.eclipse.org

    --
    http://dtum.livejournal.com
    1. Re:SWT by Anonymous Coward · · Score: 0

      How in HELL is this a "troll" post?!? Impractical, yes, but a valid opinion considering the relative performance/complexity of SWT vs Swing.

  80. We need Java 3... by tbspit · · Score: 1

    The article is written by one of the most active Java book writers ever, so he's probably written about every aspect of Java and needs a version 3 to write some new books.

  81. Java/JavaScript's ultimate failure by Anonymous Coward · · Score: 0

    Java was designed as an easy to use language, targetted to the business user, NOT programmers. It was designed to replace, especially, the much missed and eminently useful dBaseIII+. ParadoxDos 4.0 also solved huge problems for businesses, neatly and inexpensively.

    The author is complaining about all the gotchas. These languages are useless for a business. Most businesses just go back to file cards(!), the Windows 98/XP/2000 world just doesn't cut it. The only contact with J/JS is through an IE browser window, it'll never overcome that experience.

    There's a huge sales opportunity here, I guess you don't have the temperament to take advantage of it. Sun has never produced consumer level software, and won't, StarOffice notwithstanding. Oh, Dr. Pauker, where art thou?

  82. Threading by Amazing+Quantum+Man · · Score: 2

    "Java was the first major language to integrate multithreading as a fundamental feature rather than a special purpose add-on library."

    Obviously the man has never heard of Ada83. OK, they were called tasks instead of threads. They were still threads.

    --
    Fascism starts when the efficiency of the government becomes more important than the rights of the people.
    1. Re:Threading by Ivan+the+Terrible · · Score: 1

      Obviously you have never used Ada83. Ada has rendezvous, but not threads. The semantics of rendezvous differ significantly from the semantics of threads.

    2. Re:Threading by Amazing+Quantum+Man · · Score: 2

      Rendezvous was the official interthreading/synchronization mechanism. Ada tasks are independent threads of execution within a single process. Please explain how that is different from "threads".

      Yes, I have used Ada83. The semantics and synchronization are radically different from Java, and from the threading model we've come to adopt, but that doesn't mean that they weren't threads.

      --
      Fascism starts when the efficiency of the government becomes more important than the rights of the people.
  83. remove tokenizers?! by HaiLHaiL · · Score: 2, Insightful

    removing confusing and unnecessary classes like StringTokenizer and StreamTokenizer

    wtf? obviously this guy has never parsed anything in java. StringTokenizer is infinitely useful (though I must grudgingly confess to liking c#'s String.split(char[]) method). StreamTokenizer is much harder to use, but very helpful for parsing CSV files.

    geez, don't throw the baby out with the bathwater. that includes leaving my primitives in place too.

    --


    reech bee-yond ur clip-0n
  84. Re:Not the answer by sunking2 · · Score: 2

    Of course it works, but it isn't at least what I would call the correct model (My opinion only).

    Using the typical ISA/HASA comparison between inheritance and composition a flyingboat IS A plane and IS A boat. It's not an object that HAS A plane and HAS A boat.

    Sure, you've created an object that works the same but doesn't really model the objects at hand.

    try this call with the above:
    class airport {
    takoff(plane);
    }

    ..
    ..
    airport.takeoff(flyingboat);

    it won't work real well.
    Multiple inheritance is really my only gripe with java.

  85. Re:Not the answer by NorthDude · · Score: 1

    Well, I can't argue about your ISA/HASA comparison.
    and for your airport to work with the composition model, it should only expect to receive and interface, flyable for instance.
    Then your flying boat could implement flyable AND moveable. When you'll call takeoff, passing it flyingboat, it would call the method move or fly or whatever provided by the flyable interface.

    Anyway, no need to both argue so much I think :-)
    I think we both made our point...

    Have a nice day! ;-)

    --


    I'd rather be sailing...
  86. hell, I was really happy with 1.4x by AssFace · · Score: 1

    with all the regEx stuff built into 1.4, I was happy when it finally started coming out of beta.

    nothing you couldn't write yourself, but it is always nicer/easier if it is already built in.

    as for the 10 points on that list, I have no issues with them, they wouldn't bother the programming that I do or have done, and making it all truly objects would be nice IMO

    --

    There are some odd things afoot now, in the Villa Straylight.
  87. SOAP != RPC by Jetifi · · Score: 1

    I skimmed your XML critique. One of the points worth making is that SOAP is not really an RPC protocol - there is too much baggage for that - headers, envelopes, etc. It is, funnily enough, meant for simple object access...

    For RPC there is XML-RPC, which works fine enough. SOAP is more along the lines of moving data between objects. An example of this is a lightweight online client - validation and processing happens on the server, while interface niceties, user input and pre-validation happen on the client. Communication between the server and the client is as simple as if(isValid()) outputStream.write(toXML()).

    I agree that XML is no silver bullet, but it does have a large number of applications in a variety of areas. High-load network communications just may not be one of them.

    1. Re:SOAP != RPC by Twylite · · Score: 2

      Please read the SOAP specification. It was born out of XML-RPC, and developed (amongst others) by the same author. Its initial and primary focus was remote method call, which is merely RPC in an object environment.

      While it can be used for asynchronous notification, the specification deals mostly with the request and response case, where an identified function is invokved on a server and the invocation is provided with supplementary data (arguments), while the client waits for a responses which can contain arbitrary data (return value, possibly an object or structure) or out of band return data (and exception).

      SOAP was intended to kill XML-RPC, and to add functionality over and above XML-RPC (such as callbacks / notification). It is still an RPC mechanism at its core.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  88. Ugh.. why do we even need java at all by Lawrence_Bird · · Score: 1

    other than to sell a gadzillion "Java in Minutes" books? Which is the cart and which the horse here? Buzz words, media frenzies, etc seem to drive all 'advances' in computing these days, Java acceptance and use in particular.

  89. Issue number -1 by Mirk · · Score: 1
    I can't believe the guy didn't mention enum. Astonishing. A great, gaping hole in the type system of a language that spends so much of its time congratulating itself smugly on its type-safety. And it doesn't even make the top ten.

    When that sad day comes that I lie on my death-bed, and heartbroken throngs surround my frail and aged form, looking to glean what wisdom they may from my last words; and when one particularly attractive young acoloyte leans across and asks, ``O exalted master, what one thing remaineth a mystery to thee after these many years?'', twelve gets you seven that I'll reply with my dying breath, ``Why in the name of all that is holy doesn't Java have enum?''

    (For much more on this, if you can bear it, feel free to check out my rant at http://zoom.z3950.org/bind/java/comment/enum.html )

    --

    --
    What short sigs we have -
    One hundred and twenty chars!
    Too short for haiku.
    1. Re:Issue number -1 by Anonymous Coward · · Score: 0

      Why not have sets like Pascal? Pascal sets could be used as array indices, were great for switch constructs and the language contained set-oriented operators making it easy to express and test for "is-a" relationships. I miss sets... sniffle.

      The Pascal compiler was just doing bit mask operations under the covers, but that's where that stuff belongs in a higher-level language like Java.

  90. operative word is 'major' by Anonymous Coward · · Score: 0

    m-a-j-o-r language.

    Ada has nowhere near as much use as java. ever.

    1. Re:operative word is 'major' by polar+bear · · Score: 1

      I would agree with you that Java currently has more people using it than Ada, but I have to disagree that Ada is a minor language.

      How many aircraft are out there with flight systems in Ada? You don't use a minor language for that!

  91. As Ike would say... "It's MY turn!"... by fzammett · · Score: 1

    Everybody else is getting into the fray, why not me?!?

    10. Delete all deprecated methods, fields, classes, and interfaces

    Funny that everyone bitches at Microsoft for bloated software, but the same is not said of Sun and Java. This proposal reduces bloat. Sounds like a good idea. If you have an application written that uses deprecated methods (which you BETTER NOT have written while ignoring a deprecation warning! If you did, bug off, it's your problem!), you can either rewrite it or don't upgrade the JRE. Deal with it. I agree with him.

    9. Fix incorrect naming conventions

    Probably the least important proposal, I don't particularly care either way. I am quite anal in my own code about naming conventions and formatting, I have a very definite style that other programmer can recognize immediately if you have experience looking at my code (and they tend to appreciate it). So, why not do the same for the language and class libraries itself? I like this idea personally, but if it didn't happen I wouldn't be disappointed either. I'm ambivolent on this point.

    8. Eliminate primitive data types

    The idea is consistency: if everything in the language is an abstract data type, so much the better, you never have to even think about whether your dealing with a primitive or an object. I mean, there's been a couple of instances, as everyone has experienced I'm sure, where I had to deal with wrapper classes. Hey, that's not exactly a big deal. But then again, why not avoid it completely? I like this idea, but it's another I could live without, but I do lean to agreeing.

    7. Extend chars to four bytes

    Yes, excellent idea. Frankly I've never been bitten by it not being four bytes, but his argument is perfectly reasonable and makes total sense. I agree.

    6. Fix threads

    FIX them? How about make them not a total pain in the ass to work with! I've written multithreaded applications like most people have, and I'd rather do it in Java than many other languages, but I still have to think too much to do it (partially familiarity, true, but also partially because it's illogical the way it works). So, ANYTHING to fix threads is OK by me, I agree!

    5. Convert file formats to XML

    I agree. Especially in the case of serialization. I mean, if I serialize an object, nothing says I have to use it in Java again, I can pull it into anything down the road and deal with it. Yes, XML everywhere, I agree. (Now, if the hard drive manufacturers want to make a ton of money, wait until everybody IS using XML everywhere, then bump the prices of storage up. What choice will we have? And of course we'll need 10 times as much space storing everything in XML, so they'll be rich. Where's my Seagate stock anyway?!?) I completly agree.

    4. Ditch the AWT

    Don't ditch it, just combine AWT and Swing and make one good, coherent set of GUI classes. I like Swing, that's all I use for GUI work, but AWT still has things about it that are useful. Combine them and GET IT RIGHT THIS TIME!! I agree with him.

    3. Rationalize the collections

    Forget rationalizing them... cut down the number. Just give me one or two collection types that encapsulates all the functionality of the others. No reason this can't be done. That would fulfill his wish of rationalization as well, assuming they were designed properly. So, I agree, in a manner of speaking!

    2. Redesign I/O

    I hate to agree since it's been what, two revisions already? But he's right, there is basic functionality missing or poorly implemented and that shouldn't be the case after seven years. I agree, grudgingly.

    1. Redesign class loading from scratch, this time with human interface factors in mind

    Yes, the class loader needs to be fixed. Not so much because of the newbies with class path issues, but for efficiency's sake mostly. I agree. Oh, by the way, don't be too hard on the newbies... honestly, how many of you got Hello World to run the very first time? Don't lie, I doubt more than 50%!

    How to fix Java is an argument that could go on for ages, but at least this guy had the balls to come up with some ideas, and even proposed solutions in many cases. At least give him credit for that, even if you completely disagree with everything.

    By the way, I view Java as the lesser of all evils... it doesn't thrill me, I don't love it and I grudginly use it now, but there isn't anything better that I've seen (.Net has potential, but it's not sufficiently different enough to warrant a wholesale switchover). So, until something comes along that blows me away (like direct nueral programming where I picture a GUI and the functionality thereof and the code for it is written for me), I'll just bitch about Java like everyone else, and continue to use it daily.

    --
    If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
  92. myArray.length, myVector.size(), myString.length() by eyefish · · Score: 5, Insightful

    I love Java's simplicity, and wouldn't mind to keep it as it is (although I WOULD adopt the proposed changes for Java 3), but the following is what drives me nuts: Three COMPLETELLY different ways to get the length/size of things:
    myArray.length
    myVector.size()
    myString.length()

    It also drives me nuts having to convert all the time between the primitive data types and the Object data types (int/Integer, long/Long, etc).

    Other than that, even with its current flaws I simply have to love Java (I guess is like being married to someone who is not perfect, but that you wouldn't change for anything in the world...)

  93. This is flamebait... by alispguru · · Score: 2
    ... but I can't resist it. This laundry list is an instance of "all programming languages evolve toward Lisp, specifically Common Lisp. Of the ten points mentioned in the article, Common Lisp has had answers to almost all of them, ever since about 1985 or so.
    10. Delete all deprecated methods, fields, classes, and interfaces.
    When CL deprecated things, it did so by creating a new default top-level namespace (a "package" in CL terms) and leaving the deprecated stuff behind. The old namespace and the new one shared most symbols, so old and new stuff could coexist, but in general deprecated stuff would be flagged and had to be specifically requested for it to work.
    9. Fix incorrect naming conventions.
    CL is in general not case-sensitive, so it ducks the properStudlyCaps problem. CL names have always been unabbreviated except for a few historical symbols.
    8. Eliminate primitive data types.
    Never had 'em.
    7. Extend chars to four bytes.
    The exact size of the char datatype is not part of the CL specification. Implementations can and have made it bigger over the years, and programs that care can check at runtime if the implementation has big enough chars for their purposes by making a specified environmental inquiry.
    6. Fix threads.
    Threads aren't part of the CL language. Every major implementation has them, though, and all of them are easier on programmers than Java's threads (see here - scroll down about halfway to "You can't close over anything but final variables in an inner class!").
    5. Convert file formats to XML.
    Always had S-expressions as a default universal file format. See my .sig below.
    4. Ditch the AWT.
    CL doesn't have a specified GUI. The closest thing it has is CLIM, which had a lot of the speed and resource problems Java GUIs have. We had them ten years ago, though. The commercial CLIM implementations are quite useable these days.
    3. Rationalize the collections.
    CL's collections have always been rational. It mostly comes from #8 above - when objects are typed and variables are not required to be, most of your problems go away.
    2. Redesign I/O.
    CL's abstract interface to filesystems and pathnames has always been less Unix-centric.
    1. Redesign class loading from scratch, this time with human interface factors in mind.
    I gather a lot of his complaint here stems from the distinction in Java between an interface and a class. This distinction is there because of the Java designer's allergy to multiple inheritance, which CLOS has had since day one.

    There, have I pissed enough people off yet?
    --

    To a Lisp hacker, XML is S-expressions in drag.
    1. Re:This is flamebait... by scrytch · · Score: 2

      To a Lisp hacker, XML is S-expressions in drag.

      There's only one problem. Within one second of eyeballing this, tell me which "tag" is getting closed given the number of close parens:

      (foo (bar (baz (mumble (frotz (quux (blerg (feh (foof (yay )))))))

      Yes, there are syntax hilighting editors ... it seems odd to rely on one in a language that claims to have no syntax...

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    2. Re:This is flamebait... by alispguru · · Score: 2
      Within one second of eyeballing this, tell me which "tag" is getting closed given the number of close parens:

      (foo (bar (baz (mumble (frotz (quux (blerg (feh (foof (yay )))))))

      We both know the real problem is not little expressions like this, but multi-page nightmares that you would want editor support to check anyway. Hell, even vi has a lisp mode. Let me know when it sprouts an XML mode.
      Yes, there are syntax hilighting editors ... it seems odd to rely on one in a language that claims to have no syntax...

      S-expressions don't have "no syntax" - they have a small, simple, regular syntax. Writing an S-expression reader/printer is an undergrad homework assignment. Writing an XML parser, on the other hand, is at least a semester's project, if not more. Here are some ot the the explicitly-stated design goals of XML:
      4. It shall be easy to write programs which process XML documents.
      6. XML documents should be human-legible and reasonably clear.
      7. The XML design should be prepared quickly.
      8. The design of XML shall be formal and concise.

      All of these are affected by XML's baroque syntax, and I'd say it missed all of them, mostly because of this design goal:
      3. XML shall be compatible with SGML.
      --

      To a Lisp hacker, XML is S-expressions in drag.
  94. Rebuttal by Hard_Code · · Score: 5, Insightful

    10. Delete all deprecated methods, fields, classes, and interfaces.

    While I would also like to see these die, to tell the truth, Java has done an above average job here. In most other (should I qualify that as "practical") languages, there isn't even a concept of deprecated. Deprecated is your client calling you up and telling you something is breaking in a weird way and you say "oh yeah, don't use that". In Java when you deprecate something it means something. The compiler compiles in a flag, and anything that is built against deprecated methods, the compiler will spit out a big fat "THIS IS DEPRECATED" warning. You can't do much better than that. So while I'd like to see these things gone, the reality is that there is a lot of code that is using them, and they really aren't doing much harm. The most "harmful" are the deprecated thread operations. Everything else has mostly been for name changes or additional functionality. Take the most out of your own eye first and all...
    This is just a library issue, not a language issue.

    9. Fix incorrect naming conventions.

    Amen. Given that we adhere to whatever we resolve to do with deprecations, fine. But again, Sun has done a terrific job, and if you look through the libraries, I'd say 90% or greater (including deprecated stuff) adheres pretty well to the standard. Again, this is just a library issue, not a language issue.

    8. Eliminate primitive data types.

    What you want is "boxing" (like C#/.NET/CLR does), and they're already working on it: RFE 4609038 Request auto boxing of primitives in Java.

    7. Extend chars to four bytes.

    Meh. I don't use Unicode that much, so it's not as relevant to me, I'll trust you on this one. Just don't bloat up good ole US-ASCII character strings.

    6. Fix threads.

    I generally agree. The first 5 bullets are pretty trivial. I have never ever run into a problem when using threads, even with complicated synchronization implementations. The last bullet is already possible: write your own damn monitor! Nobody is stopping you as long as the sychronization primitives work. Here I'll give you a clue: custom monitor implementations. Easy as cake. I'm not sure what the author is really asking for here. Sun cannot possibly make every single implementation of a monitor somebody would like (ok, well, it *could* but why?). It gives you the primitives and you go from there. That is why you are a programmer.

    5. Convert file formats to XML.

    No no no no no no NO. XML is not a panacea. Please DON'T turn everything into XML. The formats that exist (properties format, manifest format) are simple and designed for their purpose. XML has its uses, and simple, flat, non-hierarchical, terse data, which has absolutely no expectation of being rendered visually or translated into another form, is not one of them. I don't see any REASON being proposed other than "everybody is using it". Well, if everybody jumped off a bridge...

    4. Ditch the AWT.

    Meh. I have a better one. Replace AWT with a natively back-ended Swing or Swing-like API, akin to IBM's SWT. Swing is a lovely API, but it is cumbersome to lug all the libraries around, and it is slow. SWT is a nice compromise (nice high-level abstract, generic, Java API - to the metal native implementation).

    3. Rationalize the collections.

    This is basically an argument against the deprecated classes, for which there are already replacements. I don't see much wrong with the Collections API (i.e. java.util 1.2+), and when generics arrive, it will be much more useful (no tedious subclassing or casting to contained type). The author is making some fuzzy argument that the Collections APIis not cuddly enough or something. It's a starting point - it has the most used structures (hashtable, linked list, growable array, etc.). If you don't like them, feel free to subclass or write your own. They are fine for me, and certainly don't rank up at 3 as far as complaints to Sun go.

    2. Redesigned I/O

    A bunch of non-arguments here. Again, for something like 90% of the time, this is going to do you just fine. Please DON'T sneak buffering into classes which do not announce this fact. This is the charm of composition, and I think it works nicely. Want a stream buffered? Wrap it with a buffering stream. Want a stream GZipped? Wrap it with a GZip*Stream. Anyway, there IS a new IO API, which promises much better performance (introduces asynchronous I/O), java.nio.

    1. Redesign class loading from scratch, this time with human interface factors in mind.

    Agreed. This is getting to be a headache. Especially when deploying in application servers/servlet engines that have their own custom classloaders. There probably isn't a good solution other than good documentation, and reduction of unnecessary conflicts when security is obviously not an issue (the whole reason of seperate classloaders to begin with).

    Summing Up

    Well, this article is largely gripes about the library not the language, and where it gripes about the language, those gripes are already being addressed. I would complain about things like, methods not being first-class objects (callback classes are really annoying), unspecified symbol resolution in the language spec, inner classes not being allowed to have static declarations, lack of enumeration type in the language itself, interfaces unable to declare overridable fields, array types being pseudo objects when they could instead be easily made to be real objects which could be subclassed, etc.

    --

    It's 10 PM. Do you know if you're un-American?
    1. Re:Rebuttal by Samrobb · · Score: 1
      7. Extend chars to four bytes.

      Meh. I don't use Unicode that much, so it's not as relevant to me, I'll trust you on this one. Just don't bloat up good ole US-ASCII character strings.

      Hmm. Would it be that horrible to introduce multiple String classes? Say, String (4-byte char, unicode string) and ByteString (1-byte unsigned char, ASCII string). This would introduce an extra bit of complexity, sure, but it would offer developers an acceptable tradeoff: continue to use default Strings (less effecient use of memory in exchange for maintaining source compatability and better unicode support), or elect to use ByteStrings in order to reduce memory footprint.

      3. Rationalize the collections.

      The author is making some fuzzy argument that the Collections APIis not cuddly enough or something.

      Annoying is more like it. Coming from a C++ programming background, the consistency in the STL is wonderful. You shouldn't have to consult API documentation to figure out if a collection class is threadsafe or not, or if foo.size() has the same semantics as bar.length(). API consistency means you only need to know a handful or rules to be productive, instead a plethora of a subtly different and potentially confusing rules (whose only purpose, it seems, is to create a fertile breeding ground for bugs.)

      --
      "Great men are not always wise: neither do the aged understand judgement." Job 32:9
    2. Re:Rebuttal by Tablizer · · Score: 2

      (* Please DON'T sneak buffering into classes which do not announce this fact. This is the charm of composition, and I think it works nicely. Want a stream buffered? Wrap it with a buffering stream. Want a stream GZipped? Wrap it with a GZip*Stream. *)

      I would like to see these as named parameters or option switches rather than wrappiing.

      Psuedocode:

      myStream = new Stream(buffered=No, compressed=Yes, .....)

      That is more compact and natural IMO. Plus, you get "reasonable" defaults if you specify no options. IOW, hide the details.

  95. Thread problems are overstated by xyote · · Score: 1
    I'm not sure the thread problems are all that serious. Is the memory model broken? Not really. There are some areas where additional specification would help clarify certain issues. But the big problem is that Java thread semantics are overly cumbersome. Replacing the Java memory model with a slightly different memory model isn't going to help that. Now it is possible to state thread semantics without resorting to a meta implementation. I've done it as an exercise and it is a lot simpler and easier to understand and use than the official specification. But given the political reality of things I don't think that is going to happen.

    Decouple monitors from objects? Yeah, it would have been nice if it was that way from the start. The easy way to avoid most of the problems that arise from it is to use private synchronization objects in your class implementations.

    Thread groups? That was an attempt to deal with thread scheduling issues. POSIX threads has some of the same issues. Both it and Java have to deal with having to be implemented on different platforms with unknown scheduling capabilities. Unless you are on an IBM mainframe, everything seems to devolve down to darwinian scheduling and you'd better get used to its consequences and cope with it.

    Joe Seigh

  96. Java does not need generics by Martin+S. · · Score: 2

    What you really need is generics (as in C++ templates). Java collections are vile, since they suffer from type loss even when used with "real" objects. I'm surprised that didn't come into this top ten; it's a major language deficiency.

    I should have predicted this! What is it about generics advocates ? You never quit harping on about this even though generics have been repeatedly rejected by the JCP.

    Java needs Generics like a People need holes in their heads. They are pointless, cannot be added without badley breaking the VM, they add nothing except complexity; produce code bloat, break type safety and are hated by the real OO experts, because they are a crutch for people who do not understand polymorphism.

    I'm really forced to wonder about the motivation of people who want to so badly break Java.

    1. Re:Java does not need generics by cartman · · Score: 2

      Your post is a bunch of random nasty assertions with no supporting logic whatsoever.

      > Generics are pointless.... break type safety..

      Generics BREAK type safety? At present, objects are retrieved from a collection by typecasting them! Collections are already absolutely type-unsafe. Generics are to FIX this problem. How do generics ruin type safety?

      > ...they are a crutch for people who do not
      > understand polymorphism.

      What? Generics have nothing to do with polymorphism. They don't break polymorphism, and polymorphism does not provide the mechanism that generics provide.

  97. ...a couple more things... by jedi_programmer · · Score: 1, Troll
    Rather than looking at the problem as a single amorphous blob, there are three discrete pieces to consider here:
    1. Virtual Machine
    2. Language Specification
    3. Supporting Libraries
    The biggest problem with all of these is that Sun alone owns the spec. I doubt it would be possible for highly motivated individuals to try and "fix" any of these items (as in Open Source project) without Sun legal getting their undies in a knot. Sun at minimum shot themselves in the foot by not submitting all of the pieces that make up Java to ECMA or another recognized standards body. Like it or not, this is where M$ will pull ahead with C# and CLR - even though they are everyone's favorite Evil Corporation.

    Anyone who has taken a deep look at the the JVM has to question its design (exercise left to the reader). It's interesting to see how the JVM's CISC-like, non-orthogonal instruction set has been perpetuated by one of the leading RISC vendors (perhaps it's not really RISC anymore these days).

    The language itself has lots of holes - realizing of course that nothing is perfect. Primitives in Java are messy at best. I hate having a million get() and set() methods to follow the supposed JavaBean "pattern". Why not support something like Properties in C#? Generics? Coming Real Soon Now. Unfortunately the bureaucracy and lack of timeliness in the JCP leaves someting to be desired. A quick reminder: How long did it take to get simple assertions added?

    I could easily get over some of the bumps in the JVM and language spec if the standard and extended libraries had some god's-eye view design applied to them. No one but Sun can touch the java.* packages, and javax.* is under their thumb as well.

    What rocket scientist thought of java.awt.List and java.util.List? (perhaps no one at Sun ever works with Collections and GUIs at the same time). java.net.URL is a first class citizen, while URLs in other places (such as JDBC connections) are simply Strings. Sure, these are minor details, but they reflect a lack of maturity at many levels - and as they say, the devil is in the details. I won't even go into the monster that is EJB, since that to me is a lesson in how to make the simple very complex.

    Bottom line is this: Java has its flaws, many of which can be lived with. But Sun having a stranglehold on the spec is a serious deterrent for anyone (beyond Sun) to step up to plate and make a difference. It's quite sad, since Java is the least of many evils out there in terms of building software in general, and I would love to see it mature well and eventually succeed.

    So, anyone want to redo this the right way, free of Sun's shadow?

  98. Huh?? by Anonymous Coward · · Score: 0

    Why have a strong compiletime typed language, when you just throw it all overboard using casts? If you want a scripting language, use perl, python or whatever...

    Using collections with java means generating a new wrapper class for every collection. _Very_annoying!_

  99. multiple return values by dollargonzo · · Score: 1

    it seems to me that this is just a product of the language itself and the way it was created, but do i really need to create another object just to return an extra value from a method?

    QED

    --
    BSD is for people who love UNIX. Linux is for those who hate Microsoft.
  100. This is why Sun has not made Java open source by coldtone · · Score: 2, Insightful

    If it was open source we would already have multiple versions of Java and they would all be incompatible with one another. You would have the neat freaks going with a version of java that has the articles fixes, and would completely ignore backward compatibility (Because after all were going to do RIGHT this time!), you would also have the hacker crowd who would make Java++# that would include pointers and remove garbage collection and also make it incompatible with existing code. (Because they are making it RIGHT as well).

    In a few years the language would be forked just as bad as C.

    Thank God Sun hasn't Open Sourced it.

    1. Re:This is why Sun has not made Java open source by Anonymous Coward · · Score: 0


      Like all the forks of the linux kernel?

  101. One size MUST fit all by Mirk · · Score: 1
    Maybe the most disturbing assertion in the whole of this article:
    The needs of the desktop and the server are not the same as the needs of the cell phone and the digital watch. Programmers in each environment need a language tailored for them. One size does not fit all.

    That can't be a good philosophy, can it? I think we've all been shorn of the starry-eyed naivety that had us chanting ``write once, run anywhere'' way back when; but doesn't ``write once, compile anywhere'' still seem like an eminently attainable goal?

    One Java is enough. Maybe even more than enough.

    --

    --
    What short sigs we have -
    One hundred and twenty chars!
    Too short for haiku.
  102. But they'd be immutable by apsmith · · Score: 2

    int i = 23 as in his example would, if I understood correctly, make a construct like i++ impossible. How would a for loop work? This doesn't quite make sense to me - maybe you'd need both mutable and immutable classes for the primitive types?

    --

    Energy: time to change the picture.

    1. Re:But they'd be immutable by KieranElby · · Score: 1

      > int i = 23 as in his example would, if I understood correctly, make a construct like i++ impossible.

      If you think of i++ as short hand for i = i + 1, then you'll see that it would work fine.

      After executing i++, i would be a reference to a new Integer object whose value is 1 greater than before.

      This is no different to doing s = s + "foo" where s is an instance of the String class (which is immutable).

      However, you couldn't do (mylist.get(5))++ since this would not change the object reference inside the list. That said, I don't think that's a mistake any programmer is likely to make.

  103. An Obvious Issue With This Article by SN74S181 · · Score: 1

    Maybe I've missed the boat on Java (chime right in and say so, we know you can) but I've seen Java as in part one of the most significant book-selling computer technologies that has ever existed. Almost from the beginning, what Java 'meant' was that there were going to be tons of books, many of them horrible fluffy hype, about Java. I know it's gotten better as Java has slowly become usable for more than dancing screen doodles.

    So here we have an article: '10 Reasons We Need Java 3.' Written "by one of the most active Java book writers ever." Clearly he needs Java 3, because without cycles of obsolesence, how's he going to make his boat payment(s)?

  104. amen by jedi_programmer · · Score: 1
    1. XML does not cure cancer, end world hunger, or promote peace between people with thousands of years of historic animosity. In many ways it is S-exp, rediscovered much later, done poorly.
    2. Lisp (and its derivatives) get a lot of things right, especially the minor detail of trying to take the complexity out of doing things and putting the power in the hands of the programmer.
  105. A few counter points. by kill+-9+$$ · · Score: 1

    On his suggestion of removing AWT, you can't, at least completely. Swing is built on AWT. On another note, anybody ever try to do multithreading with a Swing app, you get some interesting results and Sun doesn't recommend doing it. So really you could remove it from the public API docs, but it'd still be under the hood (like many com.sun classes)

    On his suggestion about modifying the I/O classes, true buffering is important for performance reasons on most applications. However, to me the way the Java crew implemented I/O is genius and its patterns based. You construct the exact tool you want by stringing together lots of simpler tools together. Yes it would make life easier for those who aren't comfortable with this approach, but at that point why not bastardize it completely and go back to a C style fopen() function.

    Incidentally, I wouldn't mind seeing a revision to the RandomAccessFile class in that it does behave a bit like the C-style fopen(). I don't know how you'd improve it, but it would be nice if it was consistant with the rest of the I/O classes.

    Finally, on file access, while I haven't done a whole lot of Java development on Windows or Mac, I've got to believe that a tree based file system can address all of your file access needs. Granted you might not be able to do something like new File("C:\\WINDOWS\\"), but why couldn't that be represented and accessed by "/C/WINDOWS/" or use URL style syntax. Perhaps it already does and this is his gripe. This sort of reminds me of my experience of using Perl on VMS. You could access the VMS filesystem using either the native syntax or a UNIX equivalent.

    --

    -- A computer without COBOL and Fortran is like a piece of chocolate cake without ketchup and mustard
  106. The trend by nurb432 · · Score: 1

    Todays trend in our industry is to obsolete as much as possible with each release..

    This way you can 'regain' customers that were quite happy with what they had.

    Hard to sell new product on meaningless 'features', soooo just 'force' people to 'upgrade' everything..

    Then make it all pay per use during that upgrade process.. the holygrail... income forever..

    --
    ---- Booth was a patriot ----
  107. I find it odd he didn't mention this one: by JustAnotherReader · · Score: 2, Interesting
    1. Operator overloading. If a String class can do this:

    String foo = "Hello ";
    String bar = "World.";
    String foobar = foo + bar;
    // fobar now equals "Hello World"

    Then why shouldn't I be able to write a Matrix class that has addition, multiplication, and equals overloaded to be matrix addition and matrix multiplication? Which of these two examples looks like clearer code to you?

    // assume a and b are already defined matrices
    Matrix x = new Matrix(a.matrixMultiply(b));

    or

    Matrix x = a * b;

    But let's not let this turn into a Java bashing forum. Even with it's limitations and frustrations I still love the fact that my favorite programming editor (Jext, written in Java) works exactly the same in Windows 2000 as it does on Linux. I love the fact that I can work on servlet and JSP ideas at home on Linux using Apache and Tomcat and then go to work and flesh out those ideas on Windows 2000 with WebSphere. Then, when we move that program to production it runs on an IBM mainframe running AIX. All without requiring a recompile.

    No language is perfect. Any language can be improved. The 10 points in this article would make Java an even better language than it is now.

    1. Re:I find it odd he didn't mention this one: by Frogg · · Score: 1
      Matrix x = new Matrix(a.matrixMultiply(b));

      There's no need for you to create a new matrix - I would just write:-

      Matrix x = a.matrixMultiply(b);

      ...I have in fact done exactly this in the past.

      There are many arguments against operator overloading, which I'll not get too into here - try some of these pages if you're interested. Mostly, the argument against revolves around the fact that they can lead to 'tricky' code if used in a stupid fashion. Countering that argument: I've programmed C++ and I've implemented matrices in the fashion you imply - and the code was fairly intuitive, and seemed much more readable than if it'd been implemeted using objects' methods. (Of course, under the hood, it's really all the same in C++!)

      Perhaps we need something like java.math.Matrix, which would work in the way you suggest? - but without needing operator overloading. Afterall, what we really want is probably support for matrices, imaginary numbers, etc - and not operator overloading per se.

      Just my tuppence worth...

  108. What Is Broken with the Article by sergeaux · · Score: 1

    The fact is that it is not Java that is broken, but the common perception of what is actually needed, and this very o'reilly article shows that clearly. It is not possible to "fix" a language just by removing bad API and generalizing its ad-hoc constructs. It is mind which needs fixing.

    One might say Java is secure. It is secure in terms of JVM, but it is broken in terms of typing, and it is funny to see this skipped in the article. For example, collections are not type-safe.

    One might think Java is reliable. Yes, its object model forces people not just to implement things, but also to someway "declare" what they are going to do. But "enterprise programming techniques" are mostly about overcoming this, for they use "reflection", which is about overcoming type restrictions.

    Java has born templates. As somebody already noticed, templates are means to secure job, for nobody else will be able to figure out what's the hell is going on in your code. It's a joke, but the actual reason why templates are bad is that that they are a hack: Java is not expressive enough to let people develop abstract algorithms.

    People are used to OO modelling. That's good by itself, but the common practices are harsh. Everybody knows that virtually any UML guy is capable of producing tons of completely incomprehensible diagrams, incomprehensible save to him. By programming, we build a computer model of the problem we solve. Since people generally dislike abstractions, it is considered more useful to have the world totally modelled than to have as much abstractions as possible found. So, just to add two integers, objects are created, and messages are passed. Nobody even tries now to teach programmers think abstract.

    Let me make a conclusion. It is not because Java is good by itself that it has gained so much, and not because it is convenient lots of people are forced into it. It is because it is really a sort of agreable common ground (And it is better than VB anyway :-)) There is not reason to neither fix or drop anything in it; just push for better implementation and more standards. But if you feel like looking for something true and ethernal, try objective caml, and implement a java bytecode compiler for it.

  109. Don't confuse implementation with semantics by SimonK · · Score: 2

    Noone (or noone significant anyway) thinks the
    primitive types should be layed out in memory
    the same way as object types. The argument is
    that they should be semantically the same,
    but implemented differently. Thus, if I
    want to take the sine of a number, I can
    write:

    (6.0).sin()

    Rather than:

    Math.sin(6.0)

    Which involves the nasty, irrelevant class "Math". You should also be able to subclass the primitive types. Furthermore you can remove the length and precision limits on the various types. Integers should be stored as 32-bit ints where possible, and then gracefully degrade into big ints when they exceed 32 bits.

    The technology to do this already exists. Lisp and Smalltalk VMs have done it for years. Unfortunately, the developers of Java got confused in just the same way as you're doing.

  110. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  111. I don't buy that. by nobodyman · · Score: 1


    I dunno. Breaking compatibility is always dangerous, but eventually you have to erase the mistakes. You can still write code that uses the 1.0 event model and uses all of the deprecated classes/methods.

    People managed to catch on to java 1.0 when there was no compatibility to anything else. People are catching on to C# because of it's syntatical/conceptual sililarities with C/Java (and the the mammoth marketing budget). With this in mind, I don't doubt that you could make "Java 3" that scraped off some barnicles.

  112. Generics and Primitives by SimonK · · Score: 2

    Generics are well on their way. They keep getting held back from actualy inclusion in the VM, since in practice their absence is just an irritation, but the standard is already signed off. C++ templates are a pretty poor example of generics anyway. It has been done much better elsewhere.

    You don't really explain why you think the primitive types are necessary, so it is hard to answer you, but the fact there is no common supertype of the primitives + Object is a complete PITA if you do anything complex in Java. Just look at the JDBC interfaces for an example. The need to promote and demote primitives to get them into collections is a major source of inefficiencies in Java programs.

    Just to avoid any misunderstandings: the point is to give the primitives object-like semantics, not to store them in the same form as other objects, or to require people to use object-like syntax. The technology to treat primitives as objects has existed for Lisp and Smalltalk for years. The only reason it hasn't made it into Java is NIH syndrome.

    Another thing he missed: metaclasses

  113. We already have Java 3, but it's called C# by Blue+Lozenge · · Score: 1
    I'm serious. Switching from Java 2 to C# was like getting a major language upgrade. Everything was cleaner, faster and with syntactic features that make coding much easier. Combine C# with the .NET Framework, Managed C++ and standard C/C++, and you have a amazing set of tools. I can easily do things now, that I would never have dared waste my time on in Java.

    Flame on. I know you want to.

  114. 6 Reason why we don't need Java by ZioPino · · Score: 1

    1) Plenty of languages that do what Java does and in many ways better (Perl, PHP come to mind)
    2) Ivory-tower design plagued Java for years. Still today it's very hard to control external processes or work on "real life" entities like the file system. The shell language can do things that Java can't.
    3) Even with primitive types handling of data in Java is cumbersome compared to other languages.
    4) The JVM is really an attempt on rewriting an new OS. We have an pseudo-OS on top of an OS. Should we focus on writing useful software instead ?
    5) Speed might have improved but Java is still one of the most memory-hungry languages out there.
    6) Elliotte has written a lot of non-sense starting from the first book I reviewed at the timeof the release of Java 1 and he still continues. Proposals like 4-byte char and use of XML everywhere are the clear demonstration of the ivory-tower mindset of some Java people. It's about time we forget about these jerk-offs and start writing software that is usefull, optimized, and to the point.

    1. Re:6 Reason why we don't need Java by Anonymous Coward · · Score: 0

      Perl is an ungodly hack. Useful in a scripting sense, but god-awful in big projects.

      I can see promoting other languages over Java before Perl.

  115. Re:myArray.length, myVector.size(), myString.lengt by Anonymous Coward · · Score: 0

    There are easier ways to claim how well hung you are, you know...

  116. Ahem ... by SimonK · · Score: 2

    That would be why the JCP is working on a standard for them ? and why there is an implementation mechanism (type erasure) which requires only a small change to the VM ? and why 1.5 is slated to include them ?

    Hmm ...

  117. The problem with java by Anonymous Coward · · Score: 0

    Is that it sucks for client side apps. MS was the only one working on improving it, albiet for their OS only, and Sun put a damper on that. Now Sun wants every windows user to switch to their VM which is many magnitudes slower then the MS VM. Moreover their VM is extrememly bug riden. Upgrading to Java 3 will porbably only make things worse, as performance has actually gone down with each subsiquent release. And for all you Mac guys out their touting their cool VM, its a shame it doesn't fully support java, missing things like Java 3d classes. Unless someone produces a much better VM designed to improve client side performance I predict client side java will die in the next 5 years. Its to bad since it would be nice to write an app that works on all platforms. And the whole applet scheme under all of the various VMs is just that much worse.

  118. Yes! by croanon · · Score: 1

    My two fathers and I are having orgies every night! It should be hard for your mom, but she looks like she is able to handle three cocks. Lucky boy! ; )

    --
    Dear Bill, do you have a .net tatoo on your ass for marketing?
  119. You could avoid the overhead ... by SimonK · · Score: 2

    ... in Java, because it is statically typed. Where code is not polymorphic, and manipulates the primitive types directly, it would be possible to use full-precision numbers, as supported by the hardware, just as Java does now. Something like C#'s automated boxing and unboxing could be used when the primitives were assigned between a polymorphic and a non-polymorphic context. That would answer the performance concerns with needing to distinguish fixnums from reference types, and still give fully OO primitives.

  120. SCCCL by HiThere · · Score: 2

    I find myself quite dubious. I don't particularly like the Sun license, so much so that I haven't even been updating the current versions of Java. (I'm hoping that Python or Ruby will expand to fill the spot where Java currently resides.)

    Sun hasn't given much sign that it intends to improve it's licensing. McNeary's recent comments seem to inticate that it may tighten up on it. And the current license is already a bit much. So I don't think any new version would be attractive. I'd rather trust Miguel's version of C#, but I have this suspicious mind that keeps hinting that MS holds patents that will sink either it, or large portions of it.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  121. (nt) NO, JDK1.5 == JAVA 2. by croanon · · Score: 1

    nt

    --
    Dear Bill, do you have a .net tatoo on your ass for marketing?
  122. What an idiot... by kill-1 · · Score: 1
    This guy writes Java books? I hope they don't sell, because his "10 reasons" are mostly idiotic.

    His points 4, 6, 9 and 10 are only about ditching deprecated APIs and not about "incorporating the advances in the last 7 years".

    Point 8 is really stupid. He writes:

    In essence, a good compiler should be able to figure out when to use ints and when to use BigIntegers and transparently swap between the two.
    and
    The integer types offer real room for improvement, however. It is mathematically incorrect for two billion plus two billion to equal -294,967,296, yet it does in Java today.
    Is he on drugs?

    Points 2 and 3 are the only ones I agree with, but they don't require a Java 3, that is not backward compatible.

    And in point 1 he writes

    I'll freely admit that I don't know how the class loader should be fixed.
    All in all, this guy seems to be a complete idiot. How comes he writes Java books?
    1. Re:What an idiot... by J.+Random+Software · · Score: 1

      He's not on drugs re int and BigInteger. It doesn't take much runtime support to shift between bignums (boxed) and fixnums (stored in most of the bits of a pointer, with a few left over as a tag). Lisp vendors have offered this for decades, complete with optimization (store a native integer if a value is proved or declared to stay in its range).

  123. Swing is slow, by Anonymous Coward · · Score: 0

    The generic classloader is slow. Java is not particularly slow.
    Look at the effort needed to implement a new GUI layer.
    Look at what eclipse is doing with SWT.
    Ask yourself why they're going to the trouble.
    The answer is that the GUI layer is slow, the logic layer is (reasonably) fast.
    Why doesn't Sun work on it? They don't care anymore, what's selling for them is (non-GUI) server code so they are (rightly from a business perspective) concentrating on J2EE, not J2SE (which is a lot of what we're talking about).

  124. Make users happy first, then please programmers. by Anonymous Coward · · Score: 0

    Most of these changes are for the programmers' sake. The author seems to have forgotten that the point of programming is to satisfy users' needs, not to amuse programmers.

    Java falls short of user's expectations in at least two areas:

    1.) Performance. It's still too slow overall and the Image classes are incredibly inefficient.

    2.) The UI sucks. It's easy to make a crappy UI in java, but it's basically impossible to make a good UI. The File chooser/open/save windows are pathetic. There are all sorts of little nuisances in the widgets. There are no good UI tools for java like microsft has for c++.

    The next version of java should focus on the user's experience.

  125. and Elliotte Rusty Harold.. by geekoid · · Score: 2

    ...Number 1 reason for Java 3... Needs to make some more money from another book.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  126. Procedural by Tablizer · · Score: 2

    What about good ol' functions? Even many OO fans agree that "sometimes procedural is the right choice for a particular problem".

    "system.this.that.print()" is a Demeter Principle violation anyhow.

    Also, get rid of the "break" statement, instead allow multiple match items.

  127. I thought he would have real suggestions by tstoneman · · Score: 1

    This article is a waste of time. All he is suggesting is minor semantics when he should have addressed more important issues. I believe Java needs to address the garbage collection issue a lot more aggressively. If you want to develop an high-performance server-type application, and if you come from a C background, you want the ability to immediately free memory, not just mark it ready for garbage collection. I guess coming from a C background, I inherently don't trust things that say, "OK, trust me, I promise to free this ASAP". We have transitioned some of our applications to Java, but the biggest hurdle we have consistently come up against is memory management. Memory tends to blow out really quickly, and it makes us nervous. Even worse, Java begets lazy programming where programmers code without any regards to memory management, making it hard to go back and fix things even if a better memory manager were implemented. They have designed themselves into a corner for that one.

  128. NoNoNo! by TheLastUser · · Score: 1

    "Remove Thread Groups" - These things are used for security in applets. A thread must be in the Applet's thread group for you to modify its properties (priority, name, etc.).

    "Eliminate primitive data types" - This is just plain stupid. Why create an object to use as a for loop counter? If you want to use objects for all of your primitives, go right ahead, use Float and Long, etc. Personally, I prefer to get something in exchange for giving up efficiency, and Object oriented utopia doesn't cut it.

    "Drop all depricated stuff" - Why can't this stuff be phased out slowly. What's with the shock treatment? Why not get rid of all the 1.0.2 stuff depricated in 1.1 now and, when most people have adopted 1.2+ vms, we can start to make the other changes. Either way, what's the big deal? If we take them out of the docs, will that be enough? Don't say "in the interests of efficiency", not after the "eliminate primitives" thing.

    "eliminate 1.0.2 event model" - Well, I can't argue with that.

    "replace all data formats with xml" - Mighty fashionable, but if you try to pass serialized objects to an earlier VM, say from a 3.0 server to a 1.1 applet, you will also have to pass along several hunded K of parser. I suppose we could use comma sep instead, but since my StringTokenizer is gone too, I don't know what to do.

    Most of these suggestions are good, but I see no reason to leap into them in one version. Backward compatibility IS important. A lot of coders "don't get that depricated means don't use this in the code you are writing now", but people who code this way deserve what they get.

  129. What Java wants to be by dmelomed · · Score: 1

    How about built-in fault tolerance, distribution, and concurrency (and no stinking dependency on pthreads). Which are all available in a language called Erlang :).

  130. Isn't C# Java 3? by Dr.+Awktagon · · Score: 2

    C# is basically Java without a lot of the annoyances. (Unless of course you consider Microsoft itself a major annoyance..) For instance boxing/unboxing primitive types, get/set blocks for attributes (the getXxx/setXxx convention in Java is a little klugdy, imo)...a foreach operator ... enums ... delgates (like "function pointers")...other stuff..

    Basically Microsoft did the usual microsoftish thing, they looked at what's available, ripped it off, and changed the bits that they thought were annoying.

    I must say after reading some C# books on O'Reilly Safari I like C# a lot more than Java and am looking forward to 1) a C#->native code compiler for linux and 2) a C#->Java bytecode compiler (it must be possible).

    The author is right, in spirit (even though I don't agree with every detail). Java is starting to look a little crusty. I believe the reason Java took off so much in the beginning was because people were desparate for a "better C++". Now as time goes on we need a "better Java", as we search for that elusive "perfect language"..

  131. FP in Java by axxackall · · Score: 1
    Hmm, it might be interesting to have lazy evaluation in Java. I'd like to mix program generators with XSLT - that might bring a new level in XML messaging.

    In a lack of it I have to use Kawa and suffer from performance.

    --

    Less is more !
  132. Templates=generics by Aapje · · Score: 2

    Templates are called generics and available as an extension to Java: GJ. This implementation (or at least something very similar) will probably be included in a next version of Java.

    BTW. If you are a member of Sun's Java Developer Connection (free), you can vote for the features and bugs you want them to work on. Vote for Generics! Of course, sharing memory between JVM instances is also a good feature to vote for. It has been proven to be possible already (MacOS X' JVM), so they just need a kick in the ass.

    --

    The Drowned and the Saved - Primo Levi
  133. This is all academic by gruntvald · · Score: 1

    without a way of stopping Microsoft from throwing old and incompatible pseudo-JVM's into their browser, simply to fuck with the developer community. First they take it out, then they throw the wrong version back in. Bah.

    1. Re:This is all academic by jbolden · · Score: 2, Informative

      Microsoft's browser support running the JVM of your choice. I've been running Sun's on I.E. for years now. You do the same things with your Java apps that sites did for years when they posted Acrobat "to use this site you'll need...".

  134. Ohhhh, wait by The+Bungi · · Score: 2
    For so many years, every time someone came up with a "Top 10 List of things X Should do" we've had to put up with the interminable witty "use Linux" or "use OS X" or "use Java" replies.

    This time around however, I'd like to respectfully point out (as many other posters already have, although they've been mostly modded down as trolls) that every single thing this dude wants Java to do is already in... wait... C#.

    Actually, I think this article was quite the exercise in hipocrisy. For every single point made in the article he could have added "C# already does this" at the end. I'm sure he came up with all those insightful recommendations thanks to a visit from the Angel Of Languages, instead of from intalling and using Microsoft Visual Studio.NET for a few months and reading the ECMA spec for C#. Yeah, I'm sure that was it.

    Microsoft created C# (and .NET) to compete with Java at the enterprise level. I think it's obvious they're succeeding when one of the "leading voices" of Java cries out and demands the very things that are built into C#.

    I actually hope Sun (yes, everyone here loves Java so much despite the fact that it is a language controlled by a single company, like... wait... C#) does all this to Java. That will make it a much more level playing field. But alas, they're paralyzed by the need to have backwards compatibility, which is important regardless of this guy's acid dreams. No company, not even Sun would risk their current user base to clean a language up. Sorry!

  135. Maybe if Java were Smalltalk Instead... by jarober61 · · Score: 2, Insightful

    Sounds like most of the author's complaints have been addressed 20 years ago, in Smalltalk. Now maybe if Gosling had done his reading.....

    --
    Talk Small and Carry a Big Class Library
  136. Re:Ugh. I Disagree. by bnenning · · Score: 2
    Primitive types are nice to have around because they optimize sweetly

    Adding object semantics to primitive types doesn't have to slow things down, C# seems to do it fine. Having separate int/Integer types is a hack that produces ugly and inelegant code, and should be removed.

    Ditching the AWT means ditching all browser support.

    Why? I've run Swing applets in browsers, they worked just as well as AWT applets (which is not very, but still). I actually prefer native widgets to the one-size-fits-all Swing widgets, but Sun disagrees and I don't think they need to expend resources supporting two completely (well, mostly) separate UI libraries.

    I like my tiny, efficient serialized objects; easily compressed and not very human readable.

    And not interoperable with anything else, and prone to breakage with new versions. If you're concerned about size, gzip your XML data and you'll get close to a 90% reduction.

    He knows damn well why it can't be InternetAddress...that's used in javax.mail.internet for a totally different task!

    Classes in different packages can have the same name, e.g. java.util.Date and java.sql.Date (although I'd argue that's also poor naming).

    --
    How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
  137. Slashdot continues through the backlog? by Inoshiro · · Score: 2

    Java 2 was Java 1.2. Java 3 is Java 1.3. Sun released Java 4 a while ago (Java 1.4).

    Solaris 9 anyone? Oh, right, 2.9... ;0

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  138. XML (Re:Some observations) by Herbmaster · · Score: 2

    Onto the XML question, and getting to my area of pet hate: The XML Silver Bullet.com. The author's bias towards XML is understandable, but he needs to realise, as do the millions of developers who let the marketting machine think for them, that XML is a poor implementation of a decent idea.

    Of course XML is a silver bullet! JARs and properties files are just the beginning. What we really need is for the .class files to be nice, readable, XML documents. This will pave the way for .java code to be written in a proper XML format. There is no reason that these things need to be written in an ugly properiety format.



    My apologizes if my sarcasm is lost.

    --
    I'm not a smorgasbord.
    1. Re:XML (Re:Some observations) by Twylite · · Score: 2

      You know the problem with the world? There are too many developers out there who will read your first paragraph and say "That is such a cool idea - I'm going to do it right now!" ...

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  139. Re:Ugh. I Disagree. by dasmegabyte · · Score: 2

    It's not that Swing apps don't work in a browser -- more than Swing apps will only work in a browser under certain conditions which are not easily met by average anonymous user X.

    Maybe in a year or so, when all those XP homes have downloaded WebStart and/or NS 6.2+. Until then, I need my AWT to make fancy wavy backgrounds in my shout out pages.

    --
    Hey freaks: now you're ju
  140. Java needs parametric polymorphism by TimFreeman · · Score: 1
    In Java, all objects are optional. They can be null. The compiler doesn't help you keep track of which ones may be null and which ones are never null, so either you have to assert that each pointer is non-null as you follow it, or your code is vulnerable to getting NullPointerException's (henceforth NPE's) at any time. The assert only helps things a little: instead of failing with a stack trace that says a NPE happened somewhere in your method (it won't tell you where if it's compiled code!), your assert can put a string in the thrown exception to tell you the line where the NPE happened.

    There is a much better way. Objective CAML and other ML-like languages have parametric polymorphism. Objects by default are never optional. If you want an optional object of type Foo, then you declare it as Foo option. 'a option is a polymorphic data type. The type parameter name is 'a. The type value of the type parameter is Foo in this example.

    This way, the compiler can enforce that the non-optional objects are always present.

    Parametric polymorphism buys you a lot more, of course, but the NPE's are the most irritating thing about Java I'm aware of.

    Unlike most other programming languages with parametric polymorphism, Objective CAML also supports object-oriented programming.

  141. MOD THIS UP by Anonymous Coward · · Score: 0

    I normally never do this ;)

  142. Atomic Longs and Doubles not desireable. by ccoakley · · Score: 2

    You hit the nail on the head:

    From the article:
    The non-atomic nature of doubles and longs is a sop thrown to architectures that can't efficiently do 64-bit operations. That's not nearly as much an issue today as it used to be, however, and few VMs ever took advantage of it. If these types aren't made into objects, then they need to be as atomic as the other single-byte types.
    What he seems to be missing is that longs and doubles CAN'T be atomic on some (4 byte) thread capable processors.

    long a;
    a++;

    Will be non atomic on 4 byte processors. In the case of 0XFFFFFFFF, it first becomes 0X00000000 and then as a second operation checks the overflow and becomes the equivalent of 0X0100000000. If a thread switch occurs in the middle of the a++ and the new thread references the variable stored in a, there is a possibility of getting a value 4 billion off of the value that should be stored in there if the function performing this operation was synchronized.

    Solution: lock longs on every operation. Yuck. Just what Java needs, more overhead on numeric operations.

    Question: You point out that Java uses native threads but then complain about a lack of a thread scheduler. Aren't the two incompatible (some kernels hide thread scheduling details)? Would you really want Java to emulate threading as a method of creating a thread scheduler? Also, for single processor systems, thread emulation is fine, but multiprocessor systems don't lend themselves well to emulated threads for actual performance. How do you reconsile the two?

    --
    Network Security: It always comes down to a big guy with a gun.
    1. Re:Atomic Longs and Doubles not desireable. by Twylite · · Score: 2

      You're right - the use of native threading (mostly) precludes the definition of stricter / more reliable scheduling rules. This was intentional in the current Java specification, to allow the use of native threads.

      Frankly, I have no idea how to reconcile the two ;) Unless the specified behaviour is something you can expect to be supported on all implementation platforms (very unlikely).

      My bad experiences with Java threading have been mainly with VMs based on Windows and Solaris, where threads contend for resources in a situation where I can't make the locks more fine grained (the requirements are complex but very specific about the behaviour of threads in resource contention).

      On Windows the software behaves just fine, whereas on Solaris one thread hogs the resources all the time. This is exactly the same behaviour as the equivalent C++ application - but with that the problem could be solved using the wider variety of synchronisation primatives (e.g. overlapping mutexes).

      So, as I suggested, additional synchronisation primative may go someway to relieving the problem; but a more deterministic scheduler would be nicer ... but run into the problems you have accurately described.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  143. Not taught Java correctly? by Inoshiro · · Score: 2

    An Array is not an object. You merely are accessing a data field in its structure which is R/O. How is this hard to understand? Is is hard to understand that a vector is multidimensional (unlike a string), so its size, not its length is what you want? It makes logical sense to me.

    As for the data types, if you don't want to mess around with the "dirty details," stick to pure Computer Science languages and scenarios. In the RealWorld(TM), you write code that deals with things. I know you want to do things in less code, but it's about working smarter, not complaining about working harder. Write a class which does all the nitty gritty in an easy-to-use interface, and use only that interface. Make it generic and useful, and you'll be able to re-use that object in all your projects.

    As an example of working smarter, take Glade. With it, rather than spending 5-10 lines of code laying out and initializing a widget or part of a widget in a mega-huge init call, I can simple create an xml description file that also has the names of the callbacks for each widget. Then I just write the code to handle the call backs, and include one call that loads my template and populates it. The same is true with PHP. Why should I include hard-coded strings everywhere, when I can load a template and just ereg_replace all the escaped variable names? I can work alongside people using Frontpage or Dreamweaver, and I need never tear my hair out because of it.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:Not taught Java correctly? by cartman · · Score: 2

      > An Array is not an object. You merely are
      > accessing a data field in its structure which
      > is R/O.

      Incorrect. An array is an object with special syntax. Every array is an instance of java.lang.Object. There are no "structures" in java. Try this:

      System.out.println("Arrays are objects?" + (new int[] {1,2,3} instanceof Object));

      > If you don't want to mess around with
      > "dirty details," stick to pure CS languages.
      > In the RealWorld(TM), you write code that
      > deals with things.

      Not messing around with "dirty details" is one of the goals of almost every language.

      > Write a class which does all the nitty gritty
      > in an easy-to-use interface, and use only that
      > interface. Make it generic and useful, and
      > you'll be able to re-use that object in all
      > your projects.

      I think people know this already.

  144. For another biased view... by alext · · Score: 2

    Autoboxing is of debatable utility - see this critique.

  145. Why not just write assembler? by Inoshiro · · Score: 2

    Because it's less efficient in a man-hours way.

    You can sit down and write out a native code output setup for "common" machines, but then you've just gone and wasted a lot of effort for a sub-2% performance increase (assuming you can duplicate the OO latebinding arbitration and garbage collection any faster in "native" mode without a supporting runtime like the JVM). Each native output compiler would take at least as much man power as the one which outputs the code for use with the JVM. And then you'd need to write some sort of runtime library which duplicated the JVM for the functionality I mentioned above.

    So rather than spending thousands of man hours working on that, why not wait until 18 months from now when your code runs 200% faster? The tiny little "god" of performance is tempting, but don't go towards it if it means sacrificing all the gains from computer science in the past 20-30 years. Assembler is fast, but no one uses it except in device drivers and careful cases where it's found to be more beneficial than doing it in a higher level language.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  146. Or with some extra annoyances? by alext · · Score: 2

    See the "Petilon" critique.

    Personally I think they're pretty even, which is something of an indictment of MS's strategic planning.

  147. Don't knock XML too much... by ccoakley · · Score: 2

    What do you suggest for distibuted computing if not XML messaging in some form? IMHO, there is really no way that a C++ developer is going to be able to communicate with a remote Java application except by passing XML. The Java RMI protocol is hard to implement in another language (it serializes exceptions and pipes them across to the remote client in a non-obvious way). I don't know enough about CORBAs model to comment, but opening a socket and sending strings (with inline XML schemas to verify against) is straighforward for all languages. Building your own parser for anything sucks, but there are XML parse libraries freely or cheaply available for any programming language. Also, XML messaging is convenient because you can upgrade a server to provide extra information / functionality without upgrading clients: just spec that unknown tags are parsed and ignored. Also, most XML parsers don't choke on malformed tags. If you write your own protocol using a home brew format, specing that kind of stuff is a real pain in the ass.

    --
    Network Security: It always comes down to a big guy with a gun.
    1. Re:Don't knock XML too much... by Twylite · · Score: 2

      There are several existing standards for the interchange of information between disparate systems, and that includes languages. And a number of those are complete remote procedure call systems.

      ASN.1 has been around since 1984 (or somewhere close), and is a terse binary protocol build for this sort of communication. It is used extensively in the telecoms industry and is supported in almost every language. It is standard, well known, and well suited to the task it is meant for (which includes RPC-style communication).

      ONC/RPC is another standard protocol for RPC supported in the Unix world and support also exists for Windows platforms. It is well documented, and bindings exist for C/C++ and Java, amongst others.

      Opening a socket and sending strings is easy, but it is also slow and error prone. The use of binary encoding for numbers (which constitute a huge proportion of most parametric and return data in typical applications) is far more efficient in terms of bandwidth, processor usage and code quality.

      As for ignoring tags, this is a hack concept introduced by this technology, and is something to be considered with the utmost suspicion from a software engineering viewpoint. Servers should never ignore parameters from a client, as these are (obviously) there for a reason. This type of thing causes subtle errors in distributed applications that are incredibly hard to trace, because they relate to application versioning rather than functionality -- and few organisations have configuration management skills or procedures to match their testing/debugging procedures.

      I'm not recommending home brew. But I am also not advocating (in this situation) a multiply-redundant encoding with unreasonable overhead which is not meant for a high-volume environment. There are many preexisting standards which meat the requirements, but aren't buzz-word compliant.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    2. Re:Don't knock XML too much... by ccoakley · · Score: 2

      Thanks, I'll have to look into these. Sad Disclaimer: I am teaching a college course in Distributed Computing this Fall. I'm using Java as the implementation language (why? Because it's at a University and the students learn Java first). I was planning on using XML message passing because I have a student that refuses to work in Java (so he ports all of my framework to C++) and I am loath to use RMI. My bandwidth requirements are very low--reconfiguring my problem requires sending an objective function, the clients are genetic algorithm machines, so they consume memory without consuming bandwidth. The distributed computer is headless and unreliable (I am having students with dial-ups participate). My problems for my students all come from my real job working for a defense contractor (mostly scheduling, resource management, and similar OR problems). Due to academia's love for XML I will probably still use it, but I will probably suggest rewriting the protocol in one of the ones you just offered as a group project (and what better way to learn something than to assign it to undergraduates ;) ?).

      As far as the Hack mentality (of ignoring tags): labeling the schema of your XML messages is actually a fantastic low cost way of getting disperate systems to talk to one another. Your argument seems to assume that it is possible to upgrade both the client and the consumer at the same time (but if you've got a better way, I am all ears). In the Navy right now, there are several different contractors with products that talk to each other and have different funding cycles, so the ammount of data passed increases with each version of each product, independent if the listener has been upgraded--and given that we are often fighting for the same dollars, odds are one of us will be upgraded, then the next, then the next, etc. The extensibility model works really well for us in that environment. I put extra information in my XML output, when you get your funding, you actually parse and use them. However, if I have my way, I'll get my next round of funding before you get the chance.

      --
      Network Security: It always comes down to a big guy with a gun.
    3. Re:Don't knock XML too much... by Twylite · · Score: 2

      For academic instruction XML is not a bad idea at all. I believe it is a bad implementation, not a bad concept. It is conceptually ideal for many forms of communication, and has benefits in academia: it is well studied, resources are available, and it is easy to view the protocol in action and dissect every step (without resorting to deciphering binary packets).

      I'm sorry I didn't present the second part of my argument clearly. The problem of ignoring parameters is more serious when you can't upgrade everything simultaneously, and especially when you upgrade the client first.

      For example: a method is upgraded to take an additional parameter "skew" (it just adds that number to the return value). The client happily calls the server, not knowing that the server is running an older version of the software, which ignores the "skew" parameter, and returns the wrong result.

      Careful schema control, and having the client identify its schema/API version to the server is a good way to handle this, but developers are notoriously bad at meticulous API versioning (which falls into the category of tasks I referred to as configuration management).

      The best practice is to clearly separate the two versions of the API -- introduce completely new functions when you need to add parameters, don't simply use what appears to be overloading (but isn't). An alternative practice is to use inheritence to make v2 of the API a subclass of v1, with additional (possibly overloaded) functions.

      Essentially, you need to treat the distributed environment no differently from objects on a local machine. If you add parameters to a method, you must provide a new, separate, overloaded method. Changing the existing method would break existing code which uses it - so you don't do it. If it makes sense to do so, the old implementation can be changed to call the new method with some default parameters - but this is not always the case.

      As a rule, ignoring data is a bad thing. It its not used, it probably shouldn't be there ... and if it's there, it should probably be used ;)

      AAMOI, the Visa 3D-Secure specifications permit certain communication end-points to ignore certain fields for forwards compatibility, but within a strict framework: some servers and/or messages cannot ignore fields, and any field of any message can be marked such that the recipient MUST understand the field, or force the transaction to fail.

      But, it must also be understood that the Visa framework does not operate using SOAP (or a system where the target function is indicated within the request); updating legacy systems to talk to new URLs (possibly multiple URLs, to support multiple versions) because an API has changed is not an option, and the framework has been designed to operate within the constraints of the current web services that offer e-commerce.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  148. Re-inventing C# (Re:backwards compatible) by gigi · · Score: 1

    Sounds like he is re-inventing C#.
    But forgot the most for powerful feature of C# -
    Attributes, which allows you to do things like XmlSerialization with no hand-written code. I think Attribs will improve the way we write DB clients.
    If you want to see an example, go see Example4, listing one.

    It's also annoying he never mentions the term "boxing" and "unboxing" when he talks about turning 'ints' etc into objects. Sometimes you can borrow a page from your competitors' vocabulary.

    Also - how about adding the following C# language features:
    A) foreach(Type t in mylist){...} to prepare ground for templates
    B) tailcall IL instruction to allow Prolog etc
    C) System.Windows.Forms for a fast windows kit
    (goodness, IBM had to invent their own AWT replacement to create eclipse IDE)
    D) enums which can be flags, which can be or'd together
    E) events + function pointers ("delegates" in msspeak)

    go mono! /g

  149. Further details. by Inoshiro · · Score: 2

    A special syntax since it acts very much like a structure. And, as the Sun docs state, "Arrays are supported directly by the Java programming language; there is no array class. Arrays are implicit extensions of the Object class, so you can assign an array to a variable whose type is declared as Object." There is no class to implement the length member like the original poster wanted. Implicit isn't quite the same as is, IMO.

    "Not messing around with "dirty details" is one of the goals of almost every language."

    One of the goals, yes, but that doesn't mean you don't sit down and work with them somewhere. Smart programmers abstract it away, as I suggested to the original poster who stated that he hates mucking about with the primitive types. Based on how he was complaining about it, I don't think my suggestion that he abstract it away was at all off base.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:Further details. by cartman · · Score: 1

      > A special syntax since it acts very much like
      > a structure. And, as the Sun docs [sun.com]
      > state, "Arrays are supported directly by the
      > Java programming language; there is no array
      > class. Arrays are implicit extensions of the
      > Object class, so you can assign an array to a
      > variable whose type is declared as Object."
      > There is no class to implement the length
      > member like the original poster wanted.
      > Implicit isn't quite the same as is, IMO.

      This point is clearly debatable. I suppose it is reasonable to say that arrays are not objects.

    2. Re:Further details. by Anonymous Coward · · Score: 0

      Dude, his response beats the hell out of yours!

  150. Hey, I never thought of it that way before. by Inoshiro · · Score: 2

    I guess I was bashing a square peg into a round hole :) Using templates around hetergenous data structures makes a lot more sense than what I thought they were for.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  151. JDJ online.. by Frogg · · Score: 1

    The Java Developer's Journal can be found here: http://www.sys-con.com/java/

    Unfortunately one needs to pay a subscription fee to access the archives. :(

  152. Some old myths surfacing here again by Anonymous+Brave+Guy · · Score: 3, Insightful
    Multiple inheritance has major problems (if both superclasses have the same function, which one do you use?).

    Multiple inheritance of implementation has absolutely no major problems. If you have a conflict in a derived class, you can simply rename one or both functions in its interface. When your object is used as a base class object, it advertises the base class interface, and when it's used as a derived object, it advertises the derived interface, with the renamed features. If your derived version wants to provide an override of either or both base classes' implementation, you can always do so. None of this violates the Liskov Substitution Principle, or any other OO design rules. The only reason languages don't support MI is because it would break their object model or something that depends on it, not because of any theoretical flaw with MI itself.

    I agree, often MI is not the right answer to a design problem. But when it is, it is. If your type genuinely can be interpreted as more than one base type and behave as such, multiple inheritance is the correct relationship to model that.

    The usual arguement against [overloaded operators], that it's very easy to change the semantic meaning of an operator and this can confuse developers, is just as applicable to an "add" method, but I don't think it's a devastating loss to the language.

    Indeed. The arguments against operator overloading are bizarre to say the least. "We don't like artificial operators!" they say, as they concatenate their strings using the + operator, while writing z1.addTo(z2) to add two complex numbers.

    Added to which, as I've argued here before, operator overloading is a very important complement to writing generic algorithms. If I want to write a generic summation algorithm that can add the elements of an array of any type, is it more sensible for me to write it using the natural + notation and provide the ability for complex numbers, rational numbers, fixed point numbers and such to implement that operator, or is it smarter for me to hope that everyone gives their classes a method called add, and not addTo, sum, increase, or bananaMilkShake?

    I agree entirely about the low-level features (hide them, don't make them part of a language like Java) and templates. Templates is a particularly glaring omission, and even the proposed generics aren't really up to the job of basic generic programming AFAICS. C++ IOStreams may suck because they gave every method a stupidly obscure name and no-one understands them, but compared to Java's "five lines of bizarre OO to read a string from the keyboard" approach, it's a godsend. A little generality would probably go a long way here, aside from improving things like the container class situation.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  153. Perl by jbolden · · Score: 1

    Look at the discussions of compiling Perl which uses the same "byte code running on a virtual machine" mechanism. The compilers evolve with the expectation of the virtual machine. As a result the byte code compiler isn't really doing anything more than adding a copy of the VM to a comiled byte code and making some of the links "harder". There is almost no speed gain and there is something of a memory loss.

    In Perl you have the worse problem of "evals", so Java should be easier. What I tend to doubt is that you end up with any real performance boost.

  154. Alternative languages for the JVM by Frogg · · Score: 1
    Already Python can be compiled into java bytecode, and if the capability doesn't already exist for Ruby, it will soon. Similar compilers could be created for any number of other languages (scheme, smalltalk, whatever).

    Python in/under Java is known as JPython, and apparently there is also an implementation of JRuby underway. There are already several implementations of Scheme and of Smalltalk too. Caveat emptor: I've not tried playing with any of these myself - with the exception of JPython.

    You can find a comprehensive list of alternative langauges for the JVM at http://flp.cs.tu-berlin.de/~tolk/vmlanguages.html

  155. Productivity by Anonymous+Brave+Guy · · Score: 2

    Productivity always depends on the developer's preferences. Personally, I don't miss GC at all when I'm programming in C++, but I find it crippling to lose basics like enumerations and templates in Java. I'm quite happy with a language that doesn't hold my hand, because I adopt programming practices that mean my gun isn't loaded so I can't accidentally fire it. YMMV, of course; that's why there are so many languages in wide use.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  156. Two questions by sacrilicious · · Score: 2
    Two things that surprised me, and for which I'd welcome any information anyone can contribute:
    [data written to a well-implemented XML] format should be both smaller and faster than today's binary serialization
    How could the XML version of something be smaller than the binary? On the "smaller" angle, a four-byte float can easily become a 12-byte string. On the "faster" angle, no conversion back and forth beats a conversion both directions. How is his claim possible?
    Both the new and old I/O APIs still assume that the complete contents of a file can be accessed as a stream (true on Windows and Unix but false on the Mac).
    What is false about the supposition that a Mac file can be accessed in its entirety as a stream?

    .

    --
    - First they ignore you, then they laugh at you, then ???, then profit.
    1. Re:Two questions by lprimak · · Score: 1

      Yeah, I agree that the XML "faster" claim is bogus.

      On a Mac (although it's being phased out in MacOS X) files have something called a "resource fork" which is not accessible via STREAMS, but a special API. It's like an attribute list that's attached to each file.

      --
      Lenny Primak PP-ASEL-IA,Heli
    2. Re:Two questions by Anonymous Coward · · Score: 0

      Thank you! :)

  157. agree with cleanup, disagree with everything els by bolthole · · Score: 2

    I think it would be a great idea to "clean up" java.

    However, I disagree with almost every single idea the guy has about 'clean'.

    Basic types like 'int', should STAY in.

    Char should stay at 2 bytes. strings are bloated enough already, and we dont need explicit klingon support :-)

    XML is a bloated pig. I thought the object was to REDUCE bloat, not increase it. So converting configs to XML makes no sense as 'cleanup'

    and lots of other things that I'm wondering what the heck went through his head.

  158. What a lame article by Anonymous Coward · · Score: 0

    10. Obviously better to keep them for people who actually write code, not just lame articles
    9. Already being done, again protecting people with investment in code.
    8. 'cause java is too fast now, right ?
    7. see #8
    6. I don't know what I'm talking about but I know they are broken (very insightful) see the jsr and doug lea's website
    5. Already being done
    4. Lets get rid of a usable low level interface beacause there is one I think is cooler.
    3. Already being done. Josh Bloch is on the case, think this guy could do better ?
    2. A couple of minor points
    1. Not a trivial problem.

    The article doesn't even mention parameterized types, which are already implemented and on the way. The jsr's go way beyond what he discusses. O'Reilly used to be good, looks like they are going downhill.

  159. Primitive-Object duality a pain by Bodrius · · Score: 2

    But it doesn't mean merging is necessary, or a good idea at all.

    C# solved the "boxing" and "unboxing" problem its own way, and I guess that's what inspired the author to propose the merge, but I don't think that's the simpler, best solution for the language.

    It is my inexperienced opinion that he pointed something better (from the point of view of a programmer that wants to know when he's dealing with primitives or with an object) when he said it wouldn't be much more complicated than the + operator for String:

    - Why not "overload" the arithmetic operators for the container classes?

    This would be part of the merging process, but it would be 95% of what's really needed, and I'm still trying to figure out why they did it for String and not for Integer.

    I can still now that "int a" will be forever an int primitive, and "Integer b" will forever be an Integer object, and will still get a compiler error if I mix them up... but "a + b" will give me sensible results.

    The other 5% of the "need" for merging comes from Collections and their use of Object. But I still don't see why this should force us to turn everything into Objects.

    Why not solve this with convenience methods in AbstractCollection and/or static methods in the Collection/Array classes?

    Static methods would probably imply less work and be a bit more consistent. Static methods for adding large arrays of primitives (and retrieving them) from a Collection solve many of the Object/dichotomy problems.

    The problem is that a method for adding/retrieving individual elements does not "belong" there. Collections.addInt(Collection c, int a) would do the work but reads a bit awkward.

    Since most of the trivial common work for a Collection is already on the AbstractCollection, having some primitive-oriented "get" methods (like in JDBC) would be feasible and perhaps sensible.

    My main gripe with this would be that I'm not sure this should be a change in the Collection interface, so as to not make it annoying to implement from scratch. But probably it should.

    --
    Freedom is the freedom to say 2+2=4, everything else follows...
  160. Mod sucks Re:Serious features seriously needed by Anonymous Coward · · Score: 0

    Moderation Totals: Flamebait=1, Insightful=2, Overrated=1, Underrated=1, Total=5.
    Moderation is a joke. The only mod point missing here is "funny" which is what this posting really is. All the "features" enumerated here were deliberately left out of Java. It wasn't Java anymore if they were implemented.

  161. Equivocation by jbolden · · Score: 1


    You guys are really having a linguistics dispute not a computer science dispute. You are using two different definitions for OO programming. Something like:

    1 - A type of program where all functions are class methods and all data is bound within classes.

    2 - A philosophy of design emphasizing encapsulation, polymorphism and inheritance. .

  162. Deprecation is the answer by gidds · · Score: 1
    I have mixed feelings about this. As a Java user (on, amongst others, an old 1.1 platform with no 1.2 JVM to switch to), I hate the idea of yet another incompatible platform. And yet, as a Java developer, I agree that most of the points raised are warts that it's be nice to fix. (I disagree on a few of the details, and especially on removing primitives, but the article does its job in asking the right questions.)

    However, there's already a mechanism for this, and one that he mentions in his first point! Stuff in 1.0 that's been deprecated since 1.1 can surely be removed with very little impact: responsible developers have had several years and 3 major JVM versions to fix their code by now. If people need to run code that old, they still have the old JVMs to run it on as well.

    And most of his other points can be solved by deprecating existing API elements and providing alternatives. The old ones will still work for the time being, and developers can get busy adapting, so in a few years the cruft can be removed. That's what deprecation is for, after all!

    --

    Ceterum censeo subscriptionem esse delendam.

  163. Casting by Anonymous+Brave+Guy · · Score: 2
    But casting is a necessary feature: I'm sure that, as much as you hate it, every so often you've been forced to do a dynamic_cast, because it's the only reasonable solution.

    There is absolutely nothing wrong with using RTTI, including dynamic_cast, where it's appropriate. The issue is that while dynamic_cast is actually a very clean feature since it has a built-in test for whether the cast makes sense, other casts (particularly reinterpret_cast, if you like C++ terminology) coerce data in an unnatural way, and that is a recipe for bug soup.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  164. 300 reasons we need Java 3 by Petronius · · Score: 1

    The ultimate list is at: http://www.jwz.org/doc/java.html. It's the ultimate reference. Much better than the O'Reilly article IMHO.

    --
    there's no place like ~
    1. Re:300 reasons we need Java 3 by GuyZero · · Score: 1

      JWZ's list is so out of date it's not funny. Some of the issues are legit, but a lot are irrelevant. It is 2 years old you know.

  165. IBM's Persistent Reusable JVM and security by Nick+Mitchell · · Score: 2, Informative
    Check this out, dudes: The 390 Persistent Resuable JVM

    The 390 machines use this not for performance, but actually for security. Each transaction uses a fresh JVM heap, so there is no possibility that errant code might mistakenly (who, me? hehe) read something is shouldn't, like the previous transaction's cleartext user info.

    nick (i believe this post is past the SAT, the Slashdot Attention Threshold, hehe, lesse if anyone reads it)
  166. Minor comments, don't require Java 3 by jkm_jkm · · Score: 1

    Of Elliotte's laundry list, only the IO and threads issues really resonate with me. But I would like to add my own:

    All Java-platform packages shall be specified as interfaces, and come with reference implementations (set of concrete classes). The reference implementations are pluggable.

    Many packages are already implemented that way (JDBC and JDBC drivers, servlet API and server containers, etc). Restructuring UI, logging, messaging, etc, to follow the same approach would be useful, IMO.

  167. Re: GC by Anonymous Coward · · Score: 0

    just as a side note, it's note the same as telling the GC to explicitly collect, but you can often assign an object to null to 'help' the GC along. Again, it's not the same, I know, but it can help the GC finish faster and maybe the act of doing so on a large enough object could kick off the GC.

    just a thought

  168. My suggestions by Anonymous Coward · · Score: 1, Informative

    I am a pretty experienced Java developer, this is my own list:

    Garbage Collection: When it takes place and how long it takes is very nebulous. I have heard MANY people say that Garbage Collection CAN be done well, but it isn't done well in Java now. Try running a webserver with a lot of threads, when you get low on memory force a garbage collect - be prepared to wait. You need more control over garbage collection, the ability to run it in the background, the ability to set time limits, do partial cleanups, etc.

    Replace BOTH AWT and Swing: Swing is broken. In each new version something stops working in Swing, it is overcomplicated and buggy. If you want to have some fun get the 1.3 source and read JInternalPane, you can find about 20 obvious bugs with ease. AWT and Swing are very inneficient. Whenever you add something to the AWT Hierarchy it generates all sorts of events, updates the cursor, etc etc. The layout managers are a mess, about 3 people on earth understand how BoxLayout works. Why isn't there a vertical equivalent of flow layout? The XUL Box container is easier to understand AND does more than most of the AWT/Swing layout managers. The way they interpret alignment, pref/min/max size and other variables changes with each layout. Things like KeyEvents are also a disaster. Swing is over-engineered, its too complex to understand and to make work properly.

    Meanwhile AWT is buggy as well, and full of deprecated and just plain odd methods. There are obvious bugs in things like targeting mouse events, focus management, etc. (Which changed in 1.4 and is not compatible with 1.3!)

    Classloader: This is one that many people may not have experience with, but is a big problem when you are running say a webserver. The same class loaded by two different class loaders is considered 2 separate classes, just with the same name. They don't share static variables, for example. There are also a lot of conflicts when the webserver uses a package and your program attempts to use a newer/older version of the same package.

    I'm not an expert on the subject but it needs to be fixed or modified somehow.

  169. No need to remove functionality, just deprecate by Sanity · · Score: 3, Insightful
    In the article, I didn't see a convincing argument why any of these changes require that backwards compatability be broken, that is the whole point of deprecation.

    If the price of not pissing off the current user-base is to support some deprecated functionality, then I really think that the good outweighs the lack of asthetic simplicity of not having deprecated methods.

  170. checked exceptions by ungerware · · Score: 1

    I've read the arguments against checked exceptions, but I must say that I find them very useful at development time. I like the fact that the compiler makes sure I'm not leaving any edge conditions unhandled.

    Now, if it were just a flag passed to the compiler to enable this checking, I could live with that.

    --

    -----
    Kvetch is Yiddish for "throw an exception" --Dr. Ron Cytron
  171. aspects by ungerware · · Score: 1

    I think Sun might want to take a look at incorporating aspects into java 3. AspectJ does okay as a preprocessor, but if it were a feature of the language, you could write aspects that affect library code as well.

    --

    -----
    Kvetch is Yiddish for "throw an exception" --Dr. Ron Cytron
  172. there are two ways about compatability by Anonymous Coward · · Score: 0

    one is in the actual language, the other is simply in the compiler. If the desire is to forget about backwards compatability all together, then why not just call it a new language. Then it would be easier to justify a complete overhaul. After all, ifyou are going to redo something without compatability then you are free to fix all the problems known without the restrictions and hold backs of a least common denominator.

  173. Sorry, but he author has not much clue .... by angel'o'sphere · · Score: 2

    1) XML and serialization
    Why should the serialization format be XML?
    Well, he is the author of "XML in a Nutshell", thats why.

    When I serialize an object I only open a file and use an formatter(ObjectOutputWriter) to write an object into that file.

    When I deserialize an object I open a file and use an ObjectInputReader to read it back.

    I simply have no touch to the file format, nor do I care about the file format and even if it was carved in stone, I would not care. There is absolutely no reason to change the serialization format.

    2) Class loading
    No single topic is as confusing to new users as the class path. I get almost daily e-mail from novice readers asking me to explain the "Exception in thread 'main' java.lang.NoClassDefFoundError: HelloWorld"

    What is so complicated in understanding how a path varibale works? All shells use PATH, even DOS use a varibale called: PATH ....

    The CLASSPATH works exactly the same. If a so called programmer does not understand the fundamentals how a computer, a OS, a shell, a program and finaly a language is working .... he is not a programmer.

    Read some books, learn something ... yes, ask questions. But do not claim the classpath is wrong ... you expect a newbie to read a XML config file where pathes are configured? A classpath variable is definitly much easyer to get!

    3) Ditch AWT for Java 3
    Oh my godness ... why?
    No one uses it. Why to ditch it and rework the stuff relying on it? Sure its somewhat obsolet ... but thats not a reason to ditch stuff.

    4) Fix threads

    A self called non thread expert says that. Yo ... well ... probably they should be fixed.

    However I like them. I never did thread programming before I used Java ... and the problem with threads is not having a suspend() or a resume() method. The problem is designing an application multithread save or better multithread friendly. Thats not a problem off some methods or not, its a problem of education for the developers.

    5. Eliminate primitive data types.

    It definitly makes sence to automaticaly wrap ints and doubles etc. into their appropriated object type when needed.

    But the claim a compiler allways can deside wether a "1" should be treated as an object or as a primitive type is wrong. A compiler can that only do with a gloable view on the class it is compiling, and not localy on a method base. Further more: this is only suitable for a class view. The gloabl view over all classes is not possible in java. Its far to easy to get a object of an unknown type via RMI into the JVM wich treats an int just in the opposite way ... so you rely on runtime optimization.

    The solution (short sighted from my side) is to allways use objects and to rely on JIT compilation and HOTSPOT optimization.

    However .... there is a basic difference in concepts between primitive types and objects.

    Objects have an identity.

    "1" and "1" are two different objects.
    1 and 1 are .... no one knows ... its a philosophical question wether they are IDENTICAL or only the same valus (do they reffer to the one and only 1 in the universe?)

    Its a hughe difference if you pass a 1 in a method call or an object which can be used as a 1.

    Call by value versus call by reference ... const and not const, identity versus equalness ... that all is to question.

    Yes, you can say: I like to have all numerical values to be objects(arg .. not values). But then you have a different kind of language.

    Its far, far more important to include contracts on a language level (not only an assert keyword), templates and probably even range checkled pointers(I dissagree here but James Coplien is in favour for them) and probably even to include more
    higher levle OO concepts directly into teh language. Like composition, mixins or even support for declarative design patterns.

    angel'o'sphere

    P.S. I use for all things I need property files ... never needed XML.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    1. Re:Sorry, but he author has not much clue .... by sh4na · · Score: 1
      "1) XML and serialization Why should the serialization format be XML? When I serialize an object I only open a file and use an formatter(ObjectOutputWriter) to write an object into that file. When I deserialize an object I open a file and use an ObjectInputReader to read it back."

      It should be wise to consider that Java wants to be a big player in the web services field, and just for that reason, it is imperative that the file and serialization formats in any program should be the same as when you're passing web service messages to and fro. And why do you care if the serialization of an object is binary or xml? You're still just calling a method, and as you say, don't care what the actual format is, right?

      "5. Eliminate primitive data types."

      Have you ever programmed in C#? You should give it a try, just so you have a feel for what the author is trying to say here. In Java, everytime you want to do something to any primitive datatype, there you go converting the thing explicitely. A big waste of time, and a serious discouragement factor to people trying to learn the thing.

      In C# (essentially java, in the end), it doesn't matter whether you declared a string or a String. You need the functionality of the later, the compiler is clever enough to know how to swap types. You wouldn't believe the ease that it gives you. You just don't think about it.

      You may think it's a minor detail, but it's a huge thing in the end, it leaves your mind free for other, more important things. And with the size and complexity of today's projects, every little bit helps.
      --
      shana
      ......gone crazy, back soon, leave message
    2. Re:Sorry, but he author has not much clue .... by angel'o'sphere · · Score: 2


      It should be wise to consider that Java wants to be a big player in the web services field, and just for that reason, it is imperative that the file and serialization formats in any program should be the same as when you're passing web service messages to and fro. And why do you care if the serialization of an object is binary or xml? You're still just calling a method, and as you say, don't care what the actual format is, right?


      I disagree. For that externalization is used. Also XML serialization may exist side by side with standard serialization.

      SOAP and other XML messaging standards go far beyond simple method calls, and therefor have an overhead and a whole infrastructure associated.

      My point is not against XML, my point is against the authors argumentation!

      In C# (essentially java, in the end), it doesn't matter whether you declared a string or a String. You need the
      functionality of the later, the compiler is clever enough to know how to swap types. You wouldn't believe the ease
      that it gives you. You just don't think about it.
      I fully support this, and I thought I made that clear.

      However again: the authors argumentation is wrong. The compiler can't allways make this desccision.

      Yes, the compiler can descide localy and swap types, but this usualy means that copies get created. And that changes the semantics. Often this changes nothing bottom line. But there is a difference. And: the author claimed a compiler allways could descide ... and thats wrong.

      My conclusion was: there are far more important things to consider if you like to refactor a language. That was the authors goal, but he mainly refactores the infrastructure and the libraries .... thats not what I call a language. And he did it IMHO poorly.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  174. Java 3 is here by pbox · · Score: 1

    Java 3 is here: download at http://www.python.org/

    --
    Code poet, espresso fiend, starter upper.
  175. Why experienced guys do better with C++ by Anonymous+Brave+Guy · · Score: 2
    I'd be quite surprised if C++ programmers would ever _overtake_ Java programmers in productivity. The biggest difference between the two languages is that Java manages some things for you (garbage collection, etc).

    I completely disagree. GC is a helpful tool in some circumstances, but no more than that. It doesn't revolutionise programming, or cause some magic shift in coding style. It's just a tool, and only one tool in a very full toolbox.

    How often do you think I actually write a manual delete in my C++ code? (Hint: I haven't written it more than once or twice in over a month, though I've refactored and extended about 2,000 lines of code in that time. I think I might have used new half a dozen times, though.)

    I don't buy the the argument: "I have experience, so my programs don't have those bugs."

    Why not? It is basic programming technique in C++ to write in such a way that you don't have resource leaks. (NB: That's all resources, not just memory -- a big advantage over Java's GC approach, which only guarantees any protection against memory leaks.) The fact that probably 90% of C++ programmers don't do it doesn't mean it can't be done. This is where the experience tells.

    I have several years of programming in C++, and hundreds of runs of PC-Lint, Purify and other similar tools, to support me on this. I don't think we write code without leaks, I know it for a fact, because I have magic tools that shout at me if I screw up.

    I have never met a programmer with sufficient experience to write large, complicated programs that are correct on the first try. Garbage collection eliminates an entire class of bugs automatically.

    So does correct programming technique. Why do people not understand that GC is almost irrelevant to C++'s memory/allocation model? You use basics like automatic variables, references, smart pointers, container classes and the RAII idiom, and that class of bugs just vanishes in C++, too. C++ programs simply do not need to be vulnerable to resource leaks, buffer overruns, etc. It's not rocket science, it requires reading and understanding one good book. As I said, the fact that probably 90% of C++ programmers haven't bothered to read that book doesn't make it wrong, it just makes them lazy. The other 10% of us routinely write code with no resource leaks.

    And yes, it is true that when writing low level code, probably for a library, you would want to put diagnostics in to catch logic errors. It's also true that this costs a modest amount of development time. But then, you'd do that in Java, too. (You do put in checks that your class invariants aren't violated and so on, right?) Compared to the cost of prolonged debugging exercises, and given the tiny fraction of overall development time that is spent adding these diagnostics, the effect on developer productivity barely even registers on the scale.

    Quality is free, or pays you back with interest. C++ provides the tools to write very robust code -- and far more of them than Java, at present -- and the more experienced the developer, the better able they are to take advantage of those tools. It's really as simple as that.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  176. tech whores need more moola by Anonymous Coward · · Score: 0

    Elliot's scheme will only benefit underemployed tech writers and consultants (such as him).

  177. Vector is not thread-safe by Anonymous Coward · · Score: 0
    >Some classes are thread-safe (Hashtable, Vector)

    He's wrong about one thing. Vector was designed to be thread-safe, but it isn't. Check out this method in Vector:
    public int lastIndexOf (Object elem){
    return lastIndexOf(elem, elementCount-1);
    }
    See it? The method is not synchronized, yet creates a stack-based copy of Vector's elementCount member. So, after elementCount-1 is calculated and pushed on the stack, but before the method calls lastIndexOf, the current thread could get suspended and another thread could run and change elementCount. Ooops.

    Of course, I agree with his solution. Get rid of Vector and use ArrayList instead and do your own synchronization if necessary.
  178. Use Python instead by Anonymous Coward · · Score: 0

    I didn't know we needed Java 2!!!

    Use Python - it rocks!

  179. I saw one good idea and one bad idea by Anonymous Coward · · Score: 0

    on that whole list.

    good:

    move jdbc to javax

    bad:

    remove primitive datatypes

    pointless:

    everything else. Like removing a whole 22 deprecIated classes will do anything. Like a few "improper" naming conventions affects anything at all. His only other gripe is "java runs too fast on modern computers."

  180. Boycott Doom 4 unless zx80 supported !! by JGoo · · Score: 0

    try{ Once and for all. Two issues. Crime : My customer doesn't want to upgrade JVM version. Punishment : Well stick sharp pointy things into a voodoo doll of your customer. If you are lame enough to develop using M$ tools, then the installers would install hundreds of finicky dll's updated. And usually ask the user which one he wants. Verdict : If the damn user wants to damn well upgrade their damn software, they can damn well upgrade the code you wrote and the code others wrote, and damn well understand that the jvm is an integral part of your product. Crime : I don't want to break backwards compatibility. Punishment : Wake up idiot. Verdict : Firstly, The new components would not be written with backwards compatibility. They wouldn't stop people having older JVM installed, nor would they remove all ability to run the older classes (i.e. the existing classes would be in there, or perhaps an optional download). Your argument about borland 6 is pathetic. That is like saying, why would someone embrace Java, if their C programs won't compile. By definition, something new has no backwards version to be compatible with. What I would like : Java 3 (we could call it java 1.5 to really confuse people, because 3 is above 2, so its 3/2 = 1.5 =) Maintains the existing great core classes - adds the cool optionals, for instance, isn't it history that all version 3 of every game was 3d? Fade to Black (Another world 3) Prince Of Persian 3(D) Lemmings 3(D) ok you get the point, Java 3 would have the Java3D API within it. Yippee! (read below for why that is so cool!) Also, IBM's excellent work and support for java would be integrated as they work together to integrate a better AWT (using SWT concepts, but making it run at a useful level on something other than windows...*cough*cough*) And then!! Create a dazzling new foray into GUI design with the sweetest collection of lightweight components, truly extensible, with no serious design problems, perhaps they could make the classes easier to extend, as this would make Java not only a viable option for client development, which it already is, but make it the only one you should consider. In short: Java 3 Java3D libraries (all 3D web content via applets! finally one standard for the web!) Update core libraries Implement a new AWT/SWT (call it SET - Standard Environment Toolkit ?) Which runs on all major platforms. Using the latest thinking in HCI, build a set of lightweight components ala swing over this new toolkit, and make them easily extensible. This would be the major area of compatibility breakage, but as 1.2 broke away by including swing as standard, 1.3 will include the next phase. }catch(UserDisagreesException ude){ throw new InvalidArgumentException("Well what do you think?"); }finally{ System.out.println("Hooray for Java!! We love Java!!!"); }

  181. Add parameterized types (aka generics) by roundand · · Score: 1

    I'm not a C++ coder, but there's one feature that does give me language envy - the ability to specify parameterized types.

    As I understand it, just as I can have an array of foo objects, with compile time type-checking for any getting or setting, I should also be able to have hashMaps, vectors or any other collection and specify the collected type when I instantiate the collection.

    There's an interesting article on adding generics to the .Net CLR at http://research.microsoft.com/projects/clrgen/ which suggests that the feature would have to be added to the runtime, not just the language.

  182. this too hoo ... by Anonymous Coward · · Score: 0

    for (Int i=aObj.n-1;i>=0;i--) { aObj2.receives(a.Obj(i)); ... } is imperative, obsolete and deprecated.

    the new OO-stype would be:
    Iterator it = aObj.iterator();
    it.setDirection(Iterator.LEFT);
    while (it.hasNext()) { aObj2.receives(it.next()); ... }

    JCPM

  183. C# by musicmaster · · Score: 1

    C# is a serious competitor for Java. Its designers have looked at Java and tried to make something better. With the advantage of the latest technical insights they surely have a chance to replace Java.

    So Java needs to be updated to the newest technical insights. For end users this will make no big difference: the new runtime will know a "compatibility mode" where you can run older versions. Their only problem will be that they hveto download that newest runtime. But I guess that the compiler will have an option to generate code for Java-2 as well.

    The real pain will be on the programmers who will have to adapt parts of their program.

  184. you guys crack me up... by Mandrake · · Score: 1
    ok, I find this hilarious.

    I just went through metamoderation, and I noticed this comment had not only been modded up, but had a lot of people arguing with him... the fact that it's an anonymous coward is irrelevant, but the fact that he linked to a non-existant study (actually it's a link to "From the Source: A Talk with Open Source Advocate Danese Cooper") and he specifically highlighted the words "ugly skank 4-eyes ho" in his comment.... man you guys should at least LOOK before you leap into the flamefest =)

    --
    Geoff "Mandrake" Harrison
    Some Random UI Hacker
  185. Re:myArray.length, myVector.size(), myString.lengt by Anonymous Coward · · Score: 0

    What is also annoying is that they're all bad names. They're all nouns, when methods should generally be named as actions. The correct naming should be getLength() or getSize() !

  186. Re:myArray.length, myVector.size(), myString.lengt by NorthDude · · Score: 1

    Like their own standard is stating...

    --


    I'd rather be sailing...
  187. hehe, pointers by Anonymous Coward · · Score: 0
    it has been long predicted by many that eventually pointers would be implemented in java. I personally don't have a problem with this. I think the exclusion was erroneous, except when looked at from a procedure point of view. Procedure here refering to the procedure of maturing a fix to something. Pointers in C++ can be very helpful, but often are cumbersome and require too much babying. If Java were to implement a way to OPTIONALLY use pointers, while providing a stable and robust platform that will prevent disasters (and track memory alloc and such) then I think pointers would be great.

    Java (as if a person) seems to want to avoid many mistakes of the past, like allowing too many problems... yet its solution is to NOT allow anything at all that could lead to this (within the context of memory pointers here and generalizing of course) Fix the framework, THEN add pointers. Provide a consistent and smooth abstracted method for use, then people can forget the option is ever there, but add optimization and tricks if they so choose.

  188. fix the problem not the symptom by Anonymous Coward · · Score: 0
    things like pointers and multiple inheritance caused problems often because of the way they were implemented within C++. Internally, the way they were handled (or not, hehe) were often more of a problem than sloppy code or design.

    Why not address this issue first before either saying "Yes, we will continue to not allow these things" or "Sure, lets just throw that schtuff back in!"

    Like with physical activity... if you get hurt, then you should not just stay innactive for a long time, rather find other ways to stay in shape. Your exercise (i.e. physical therapy) could in fact help you heal even faster.

  189. Why not additional libraries by Billly+Gates · · Score: 1

    We could introduce new features with and create our own api's and library components and give it names like swing2 and keep the old ones for compatability. I think puting addons may be the only option or perhaps creating some free compiler extensions to get the jit to do other things like making native executables and adding .Net support. I believe the source code is available to sun's jit so applying custom patches is possible. I Hate to say it but java 1.4 is already incompatable with java 1.3 in many area's so this might not be a problem.

    C++ and C evolved by aditional libraries and api's that were added by various vendors and users that eventually became standard by ansi after they were widly used. I know stl has been around in Borland and Microsoft as well as At&t's compilers years before the ansi commitee ever even standardized it.

    I noticed that many developers think any components that do not belong to sun are proprietary. Even if they are free! Perl on the other hand has cpan which there are hundreds of add-ons that are available. This is why Perl is so popular. I believe Sun must free java in order to save it.

  190. Yes, we do by Anonymous+Brave+Guy · · Score: 2

    Right now, there are glaring problems with just about every language in existence. Mostly, they fail to combine both power in the underlying programming model and a clean and safe syntax to use that model. Thinking about all the languages I know, pretty much every one could be vastly improved in at least one such basic area.

    OTOH, some languages Get Things Right(TM) spectacularly in a particular area. Perl's regular expression handling provides a powerful implementation of a widely useful feature in a pretty straightforward way. Pattern matching and enumerated types in ML provide an elegant solution to many common situations that would require reams of polymorphic twaddle in most languages. The sort of power and clarity exemplified here should be the standard, not the exception.

    Programmers today are sufficiently familiar with the basics of common paradigms and idioms that they don't need to be held back by old syntax any more (hint for C# there!), nor should each iteration of a language forever be held back by the mistakes of its earlier incarnations (hint for Java 3 there!). Old code obviously needs to run, but then that should be run against a suitable compiler/JVM/whatever. Holding new development back for compatibility's sake is exactly the reason so many languages today are just syntactic sugar for the same weak underlying models.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  191. The simplest XML Properties file in the world by Anonymous Coward · · Score: 0

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE properties
    PUBLIC "-//Sun Microsystems, Inc.//DTD Properties File 1.0//EN"
    "http://java.sun.com/dtd/properties1_0.dtd">
    <pro perties>
    <generic-property property-name="foo" property-value="bar"/>
    </properties>

    <!- -

    This supplants the legacy Java 2 properties file, the contents of which would be:

    foo=bar

    I should probably use a namespace, and although there is no hard and fast rule about capitalization of names in properties XML file elements (the W3C has a proposed formatting rulesheet to be incorporated in an XML schema that includes the entire DTD in CDATA sections, using xpointer to external entity references. We suggest using XPath an XSTLT to translate the document, we suggest mixing __camel-Hump with dashes and preceding underscores.

    -->

  192. Forth? by yerricde · · Score: 1

    (6.0).sin()

    Why does the notation for a method call with no arguments (foo.bar()) remind me of Forth's postfix notation?

    If the Java team introduces a way to call a method on two objects at the same time ({foo,bar}.baz() instead of "should it be foo.baz(bar) or bar.baz(foo)?"), watch out.

    --
    Will I retire or break 10K?
  193. Because the law changes by yerricde · · Score: 1

    why not wait until 18 months from now when your code runs 200% faster?

    Because I want to release my code before the United States Congress goes and (expletive) up federal law so that I can't release my code.

    --
    Will I retire or break 10K?
  194. C++ is portable by yerricde · · Score: 2

    C++ (which I also program) isn't exactly portable.

    C++ is portable. However, C++ does not specify a GUI layer.

    You can use a GUI toolkit such as Qt, GTK+, or the one Netscape Communications developed for the Mozilla project. Any one of those will work on BSD, Linux, UNIX®, Mac OS X, and Windows systems, covering (100-epsilon) percent of workstations in home and business environments.

    That is, unless you're talking about running on multiple embedded systems, with completely different video architectures, some of which run slower than 20 MHz and have less than 512 KB of RAM.

    --
    Will I retire or break 10K?
  195. Fixed platforms and changing laws by yerricde · · Score: 2

    The biggest difference between the two languages is that Java manages some things for you (garbage collection, etc).

    Thus forcing you to wait 18 months for hardware to catch up if you're writing a soft-real-time application such as a video game or a media player. And on some fixed platforms such as game consoles, you have to wait five years for the next platform.

    Even worse, with the current legal climate in the United States of America, if you don't get your program out NOW, you may never be able to release it because the government might ban it as a terrorist tool, or Microsoft might refuse to sign it for use on Palladium PCs because it competes with a package Microsoft sells.

    --
    Will I retire or break 10K?
  196. Apps including device drivers? by yerricde · · Score: 1

    A good language is one which allows the programmer to express him/herself in the most suitable way for the problem being solved. If a developer has to find "ways around" a particular feature of the language, then that language is flawed.

    But then you say...

    If I was asked "what is the most harmful programming construct", I would choose type casts every time - yes, even over gotos and pointers.

    Without typecasting, you can't have quick'n'dirty serialization. Without quick'n'dirty serialization, how can you write a device driver? Without a language that can express both application logic and device drivers, how can you write an application for an embedded system?

    I guess you haven't written any real-time demos or games.

    --
    Will I retire or break 10K?
  197. It's "asm" not "ass" by Anonymous Coward · · Score: 0

    OO-ass

    TIP: "Assembly" is abbreviated "asm" to avoid any sexual connotations.

    This is asm.

    This is ass.

  198. XSLT by yerricde · · Score: 1

    There are too many developers out there who will read [some sarcasm about creating a programming language in XML] and say "That is such a cool idea - I'm going to do it right now!" ...

    Except they've already done that. Witness XSLT.

    <sarcasm> Heck, Scheme code is made of S-expressions, and XML markup is isosemantic to S-expressions, so why not make XScheme? </sarcasm>

    --
    Will I retire or break 10K?
  199. Unsigned primitives by the_olo · · Score: 1

    I tend to disagree with claims that primitive types should be taken away.
    But regardless of that, integer (byte, int, etc.) types, both primitive and object-wrappers, should receive their unsigned versions - currently there are only signed ones. So e.g. C style following declarations should be possible:

    unsigned int foo;
    unsigned byte bar;
    and additional wrapper classes should be present:
    UnsignedByte quux = new UnsignedByte(231);

    When coding my own base64 encoder, I had to do lots of bit-juggling that wouldn't have been requred if I've had unsigned types in Java.

  200. Slow down by dolithe · · Score: 1

    Come on, I just spent a full year developing
    an java web application. Wouldn't be a
    great idea to start all over again? People
    need time to reap benefits from old stuff
    before moving to new stuff. Backword
    compatibility is must.