Slashdot Mirror


Summary of JDK1.5 Language Changes

An anonymous reader writes "Over at java.sun.com, there's an informative article about the new features in JDK1.5. Some of the changes like generics are nice and should make some things easier. Some of the enhancements to me are purely sugar, like enumerators. When it comes down to it, once the code is compiled, it's the same. The thing I hope is, some of this new syntactic sugar doesn't result in more obfuscated code. Unlike some people, I feel using programming shorthand leads to increased maintenance. This is especially true when you have to debug a complex application."

22 of 829 comments (clear)

  1. Programming shortcuts by GGardner · · Score: 5, Funny
    I feel using programming shorthand leads to increased maintenance

    I agree. This is why I never create my own functions or methods. Evey program should be just one big function.

    1. Re:Programming shortcuts by Angry+White+Guy · · Score: 2, Funny

      Makes for great job security!

      You wanna fire me? Have fun sorting out my code! It's commented in yiddish, if at all!

      --
      You think that I'm crazy, you should see this guy!
    2. Re:Programming shortcuts by slagdogg · · Score: 2, Funny

      The problem is that some syntatic sugar doesn't actually increase readability. Consider operator overloading.

      Maybe it's just me, but I think operator overloading is closer to syntactic poison than syntactic sugar ...

      --
      (Score:-1, Wrong)
  2. programming shorthand by nother_nix_hacker · · Score: 4, Funny

    I feel using programming shorthand leads to increased maintenance

    My code was hard to write to it should be hard to read. :)

  3. One line summary by Anonymous Coward · · Score: 5, Funny

    Java adds four new syntaxes, Python's for loop, Perl type checking at compile time, something called 'metadata', and C enumerations, all of which impove compile time type checking at the expense of making the source code look and feel like perl.

  4. Shorthand programming by Shamashmuddamiq · · Score: 5, Funny
    Yes, I'd agree with that remark about shorthand programming. I thought it was funny when I was teaching classes at UIUC to see stuff like this from the students:

    #define FOREVER for(;;)
    #define BEGIN {
    #define END }
    #define ONE 1
    #define PUSHORT unsigned short *
    #define DONE goto end

    The first thing an amateur programmer does when assigned a new project in C/C++ is to go redefine the language and all the types. I scolded them for these kinds of things, knowing that once they were forced to read other people's code often that they would realize how stupid these kinds of things are. Unfortunately, once I started my career in embedded development, I quickly learned how stupid I must have been to think that people left these behaviors behind in college... (all the above examples are taken from "professional" code that I've seen in the last few weeks)

    --
    ...just my 2 gil.
    1. Re:Shorthand programming by Anonymous Coward · · Score: 2, Funny

      a while back i did some obfuscation of my code to make it hard to read. i never really shared any of the code so it served no purpose whatsoever. i did things like:

      #define begin }
      #define end {

      but by far my favorite was:

      #define ONION UNION
      #define RINGS REGS

      so I could declare a structure:
      struct ONION RINGS o;

      for doing VESA interrupts.

    2. Re:Shorthand programming by Anonymous Coward · · Score: 1, Funny

      or better yet

      #define IS_NOT_IS_TOO_IS_NOT_FINE_HAVE_IT_YOUR_WAY !

      if (IS_NOT_IS_TOO_IS_NOT_FINE_HAVE_IT_YOUR_WAY (flag & VAL1) || (flag & VAL2)

  5. Re:FreeBSD Support by chefbimbo · · Score: 2, Funny

    It'd be about time Sun ported it to FreeBSD (the ONE thing lacking from it) but as you know, FreeBSD is dying so why bother.

  6. Thought Police by Anonymous Coward · · Score: 1, Funny

    Don't you mean /.?

  7. Re:Article didn't mention new concurrency stuff by bricriu · · Score: 2, Funny

    AtomicLong? Born in the heart of a nuclear furnace, endowed with the power of the atom, it's a bird, it's a plane, it's AtomicLong!

    Sounds like a "super" class to me. ;)

    --

    AHHHHHHH! I'm burning with goodness again!
    - Reakk, Sluggy Freelance

  8. Re:ooooh baby by slagdogg · · Score: 4, Funny

    Typesafe enums. That alone makes me quiver with happiness.

    You don't get out much, do you?

    --
    (Score:-1, Wrong)
  9. When are people going to learn... by Anonymous Coward · · Score: 0, Funny

    ....that C++ is perfect and using other languages is useless.
    C++ does it all, does it faster and although may be harder to learn, allows the programmer to make the choices. I've always beleived that if learning a high leval language like C++ is too complicated for you, you have no business working on anything even remoatly serious. I have always felt like I am being held back with most other languages, including Java, but with C++ I have felt like I can do anything. I have choice over pointers, generics, classes, friend fuctions....I guess I love the fact C++ allows you to break all the rules...which can lead to clever tricks....it's beautiful. Lower leval languages, as well as .asm have always been easier for me to grasp I guess....no hiding things, what you put in is what you get out. Smalltalk is cute though. :)

  10. Re:Article didn't mention new concurrency stuff by slagdogg · · Score: 2, Funny

    AtomicLong? Born in the heart of a nuclear furnace, endowed with the power of the atom, it's a bird, it's a plane, it's AtomicLong!

    Sounds like a "super" class to me. ;)


    Sounds like a porn star's name to me.

    --
    (Score:-1, Wrong)
  11. The Six-Million-Dollar Sweetener by SEWilco · · Score: 2, Funny
    Some of the enhancements to me are purely sugar

    I often also enhance myself with sugar.

  12. Re:Looking to Get Back into Java by doublem · · Score: 2, Funny

    I consider it to be on par with FrontPage.

    Harsh.

    Very cruel man.

    --
    "Live Free or Die." Don't like it? Then keep out of the USA
  13. Re:I think these are all great... by Doppler00 · · Score: 2, Funny

    They can't make the syntax easy to read. If they did, then it would be called Python.

  14. Re:enumerators by billnapier · · Score: 3, Funny

    That's what we've been using but my fingers get tired from typing all that extra crap in...

  15. Yeah, but... by Burpmaster · · Score: 5, Funny
    I'd say that "++x" is actually the "best" way because it puts things in verb-noun order, which I'm used to as an English speaker.
    In Soviet Russia, x++!
  16. Sig by Anonymous Coward · · Score: 2, Funny

    Arguably the most terrifying sig I've ever seen.

  17. Re:Uglification? by ptomblin · · Score: 1, Funny

    Damn, me too. That's what I wrote as well.

    --
    The next Cmdr Taco duplicate will be ready soon, but subscribers can beat the rush and see it early!
  18. I pity the software engineer... by gafter · · Score: 2, Funny

    who has to implement the new javac.

    Uh, ... wait, that would be me.