• Post Reply Bookmark Topic Watch Topic
  • New Topic

To the author: Features of Tiger  RSS feed

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Cay and Gary,

Among those new features from Tiger, which feature(s) is(are) impressed you most? And which feautres you feel the most disappointed?

Nick
 
Cay Horstmann
author
Ranch Hand
Posts: 197
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The two features that I use all the time are
  • generic collections
  • the "for each" loop

  • I like these a lot. For example, look at



    You can see right away that what the ArrayList contains. No more guesswork.
    And you can see right away that the loop traverses the entire list. No more
    checking for < vs. <= at the bounds.

    To me, the four biggest disappointments are:
  • the name Java 2 Standard Edition Software Development Kit 5.0.
  • because of type erasure, reflection works poorly for generics
  • Auto-boxing doesn't go far enough. With a couple more changes, ints would have become indistinguishable from Integers, and we could have left it to the virtual machine to optimize them
  • annotations can't reduce the drudgery of implementing properties

  • Cay
     
    Nicholas Cheung
    Ranch Hand
    Posts: 4982
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thus, among the above *issues*, would you expect that Dragon will fix some of them? or Dragon will go further for autoboxing? Any major changes that would be forseen?

    Nick
     
    Nicholas Cheung
    Ranch Hand
    Posts: 4982
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    In addition, for generic, although we dont need to cast the objects, and for the for-loop, we dont need the size(), however, do these features highly affect the performance?

    As I know, in fact, the effort for casting and counting is NOT disappeared, they just shift from the developer side to the compiler side, isnt it?

    Nick
     
    Cay Horstmann
    author
    Ranch Hand
    Posts: 197
    22
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You ask about performance of the "for each" loop. The performance is EXACTLY the same as if you had written an explicit loop. Actually,



    is the same as



    You can check this out by running javap and studying the byte codes.

    The only advantage of the "for each" loop is that programmers have to read less boilerplate code. That's a very good thing, IMO.

    Cheers,

    Cay
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!