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

47 of 568 comments (clear)

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

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

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

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

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

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

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

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

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

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

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

  8. 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 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
  9. 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/
  10. 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 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).

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

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

  12. 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
  13. 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 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.
    3. 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.
  14. 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
  15. 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.
  16. 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

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

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

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

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

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

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

  25. 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?
  26. 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.

  27. 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
  28. 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.
  29. 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.