The Java language is being expanded

This is a discussion on The Java language is being expanded within the A Brief History of Cprogramming.com forums, part of the Community Boards category; http://java.sun.com/developer/techni...2se15langfeat/ Check it out. My thoughts about it: I think they have realized their error-prone ways and in a desperate ...

  1. #1
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738

    The Java language is being expanded

    http://java.sun.com/developer/techni...2se15langfeat/

    Check it out.

    My thoughts about it:

    I think they have realized their error-prone ways and in a desperate attempt to salvage their lost cause they have tried enhancing Java with C++ "like" features.

    The int-enum will soon be gone
    Like a foe we've known too long.
    With type safe-enum's mighty power
    Our foe will bother us no more
    They shall die for saying int enums are a foe. Integer enums are like my best friend. I love them.

    I do like the fact that they are adding in variable argument lists. That has been something Java has been in need of for a long time now. Generics are nice for typecasting, but they wouldnt be needed if the Java developers had gotten things right the first time around. The new for loop syntax is interesting, however, I think they could have spent the extra development time and just made the foreach loop instead of the new for loop.

    Autoboxing/Unboxing is nice, but also I think they are a little late on the draw on it. It wouldnt be needed if the Java developers had gotten things right the first time.

    Basically that's how it is with all the features they are adding. They are nice features that should have been included in Java in the first place, but they were left out. No offense to Java, but I think C# is very very slowly winning the war.

    [edit]
    Since they wrote poems to enhance the visuality of the new language features, I will write my own poem:

    Oh Java, Oh Java,
    It came too late,
    These new features are nice,
    But you will soon meet your fate.

    [/edit]
    My Website

    "Circular logic is good because it is."

  2. #2
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    Looking good....however:

    System.out.printf("%s %3d", name, age);

    Where did they get that idea ?
    Do not make direct eye contact with me.

  3. #3
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Location
    Mt. Prospect, IL
    Posts
    2,572
    one of java's drawbacks is that it expands and changes so damn fast...

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  4. #4
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    I have a feeling that people could look at that both ways, but I understand what you're saying.
    Do not make direct eye contact with me.

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    My thoughts:

    I see signifigant improvements with these changes. They've fixed (not well, but it's a start) things that I disliked about Java:

    >Generics
    I'm a big fan of parameterized types and would probably not use C++ nearly as much if it didn't have support for them. One of my biggest beefs with Java is that many of the run-time errors could easily have been caught at compile-time. Generics take a step in that direction, which is a very Good Thing.

    >Enhanced for Loop
    This is a convenience feature, but it does eliminate the annoying need for temporary iterators. That alone wasn't a big problem, we do it all the time in C and C++, but the FormalParameter is a nice idea that removes the need for a local temporary to hold the collection item. I find the syntax very clean, and intelligent use of the feature should go a long way toward making Java more readable.

    >Autoboxing/Unboxing
    The only down side to this is that the object has to be declared as a generic type. But the advantages far outweigh the disadvantages and code will be a lot cleaner with boxing.

    >Typesafe Enumerations
    I like that they didn't go with integer based enumerations. That's a potential error zone in C and C++. I can see how some people would like to see integer based enumerations in Java because of the flexibility of having named integer constants, but the same effect can be achieved by declaring a variable as public static final. While it's useful, I think that integer based enumerations are too often abused rather than used as they were intended. So I like this feature, with a few minor reservations.

    >Static Imports
    Brilliant. This goes a long way toward removing the verbosity of Java that I dislike.

    >Variable Arguments
    The syntax looks a little awkward, but the idea in general is usually awkward, so I can forgive them. . I'm curious to see how one would implement a function that takes a variable number of arguments. I'd also like to know what inspired them to do this because variable arguments are usually a detriment to type safety and type safety seems to be the direction that Java is trying to move in.

    >Formatted Output
    I like printf, but forcing the client to specify types with a format string is error prone. I'd like to see how they avoid that potential problem. It seems like a step backward for Java if they're working toward type safety.

    >Enhanced Input
    Much better. Not great, but much better than what they had before. Probably my biggest problem with Java has been it's awful support for any input that isn't GUI based. The solution that they had before "Well, you should have been using a GUI instead of the command line" struck me as arrogant and idiotic. I guess they got too many complaints about their support for input.

    >Synchronization
    Looks promising.

    Response to DavidP:

    >I think they have realized their error-prone ways and in a desperate attempt to salvage their
    >lost cause they have tried enhancing Java with C++ "like" features.
    That sounds like an accurate assessment. But it sounds better if you simply say that Java is trying to keep pace with C++ in improvements. Whether Java is a lost cause or not is debatable. "Good" languages tend to die where "Bad but useful" languages prosper. It appears that Java is implementing features that have been desparately needed or petitioned for.

    >They shall die for saying int enums are a foe. Integer enums are like my best friend. I love them.
    Opinion on both sides. Have you tried to see it their way? I find it hard to believe that an intelligent design team would avoid a feature that is as good as you say without excellent reasons.

    >That has been something Java has been in need of for a long time now.
    Debatable. You'll notice that good C++ style tends to frown upon using variable length argument lists because of the lack of type safety. Even good C style looks for other options before using stdarg.

    >Generics are nice for typecasting, but they wouldnt be needed if the Java developers had gotten things right the first time around.
    Difficult to say. I can't see an easy solution for a typed language trying to be object oriented in a way that all objects derive from a root super class. You either end up with typecasting or some awkward parameterization.

    >I think they could have spent the extra development time and just made the foreach loop
    Language designers are allergic to new keywords. It's also not a good idea in general to add keywords to a language so late in its development. You have to consider breaking old code. Their attempt is admirable, and would adding foreach and in really make a profound difference over for and :?

    >Autoboxing/Unboxing is nice, but also I think they are a little late on the draw on it.
    I agree.
    My best code is written with the delete key.

  6. #6
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    Ah i didnt even notice the new enhanced input. Yes indeed that is nice. I have never been a fan of the way Java does input.
    My Website

    "Circular logic is good because it is."

  7. #7
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by DavidP
    They shall die for saying int enums are a foe. Integer enums are like my best friend. I love them.
    I think the following makes sense
    2. It provides a separate namespace for each enum type and thus eliminates the need to include a prefix in each constant name
    3. Constants are not compiled into clients so you can freely add, remove, or reorder them without recompiling the clients
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  8. #8
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    I always thought the Java language itself was sufficient. It's the implementation of the Java runtime that has always bugged me. The memory Java apps consume seems excessively large.

  9. #9
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    Java isnt a horrible language. In fact there are several features I really like about it.

    In fact after reading about this new update I downloaded the 5.0 beta sdk and started developing using it just for fun while at work.

    Here is one of the MAIN things that bugs me about Java: WAY to many readers and writers, including:

    Reader
    BufferedReader
    CharArrayReader
    FilterReader
    InputStreamReader
    PipedReader
    StringReader
    LineNumberReader
    PushbackReader
    FileReader
    InputStream
    ByteArrayInputStream
    FileInputStream
    FilterInputStream
    InputStream
    ObjectInputStream
    PipedInputStream
    SequenceInputStream
    StringBufferInputStream
    BufferedInputStream
    CheckedInputStream
    CipherInputStream
    DataInputStream
    DigestInputStream
    InflaterInputStream
    LineNumberInputStream
    ProgressMonitorInputStream
    PushbackInputStream
    Writer
    BufferedWriter
    CharArrayWriter
    FilterWriter
    OutputStreamWriter
    PipedWriter
    PrintWriter
    StringWriter
    FileWriter
    OutputStream
    ByteArrayOutputStream
    FileOutputStream
    FilterOutputStream
    ObjectOutputStream
    OutputStream
    PipedOutputStream
    BufferedOutputStream
    CheckedOutputStream
    CipherOutputStream
    DataOutputStream
    DeflaterOutputStream
    DigestOutputStream
    PrintStream

    whew...i doubt i even hit all of them...
    My Website

    "Circular logic is good because it is."

  10. #10
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    >In fact after reading about this new update I downloaded the 5.0 beta sdk

    How big is the download?

  11. #11
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    about 40 MB...a little bit over that actually...i think it is like 43...
    My Website

    "Circular logic is good because it is."

  12. #12
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Ok thanks, that's probably feasible with my dialup connection if I start it up and let it download overnight.

  13. #13
    Intranasal Heroin User Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,035
    grrr...lost another one to ditech...i mean java...

  14. #14
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    Java runs too slow. Period.

    I have the Java IDE and J++ and I just don't like any of it.

    C++ forever.

  15. #15
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511
    Most of you are very uninformed about how and why Java was designed. If you would do your research first you would see why they did what they did(i.e. input, enum, etc.).

    Well, here are my thoughts:

    If any of you ever have the chance to teach java and C++, two different courses in one semester-which I have done many times, you will see differences and advantages/disadvantages which each language has. I personally perfer teaching Java over C++. I prefer C# over C++ as well.

    Mr. C: Author and Instructor

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Java vs C to make an OS
    By WOP in forum Tech Board
    Replies: 59
    Last Post: 05-27-2007, 03:56 AM
  2. Is C++ going to be around?
    By BMW-Guy in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 11-24-2004, 04:20 PM
  3. C#, Java, C++
    By incognito in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 10-05-2004, 02:06 PM
  4. Languages dying
    By Zewu in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 07-29-2003, 10:08 AM
  5. Analysis of Top Programming Languages Companies Need :: Inbelievable!
    By kuphryn in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 01-06-2003, 03:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21