• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Welcome Herbert Schildt!

 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This week, we're delighted to have Herbert Schildt amongst us, helping to answer questions in the Java in General (intermediate) forum.

We'll be selecting four random posters in this forum to win a free copy of his book, Java: The Complete Reference, J2SE 5, provided by the publisher, McGraw-Hill Osborne Media.

Welcome Herbert!

For more information on this and future book promotions, visit http://www.javaranch.com/bookpromo.jsp
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Herbert!

I've been meaning to get more into 5, so I'm sure the discussions over the next week will be interesting.
 
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Likewise. I've been using some of the new features, but I'm interested to learn more about it, particularly annotations. I assume annotations are covered in the text...
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably this is a dumb question but shouldn't this new version be referred to as J5SE, after all, this is supposed to be another 'major' change to the platform.
 
Author
Posts: 253
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

Its great to be back at JavaRanch again!

Here is something to get us started: J2SE 5 has changed the way that we will program for Java. Its a big change and most programmers still don't understand its significance.

Thoughts?
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mauricio Villada:
Probably this is a dumb question but shouldn't this new version be referred to as J5SE, after all, this is supposed to be another 'major' change to the platform.


Difficult to spell, isn't it Tji-five-es-e
I prefer name Java5_or_Java1.5_or_tiger_in_the_end_it_doesn't_matter.
 
Herb Schildt
Author
Posts: 253
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is what Sun says about version naming.

In J2SE 5, the acronym J2SE stands for "Java 2 Platform, Standard Edition". The 5 is Sun's version number. Furthermore, the 2 in J2SE refers to "second generation".

As a point of interest, Sun still uses 1.5 for its internal version number.
[ March 15, 2005: Message edited by: Herb Schildt ]
 
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thoughts:

- J2SE 5.0 will change the way many of us code. It's already cleaned up my code considerably.
- The changes in J2SE 5.0 will be ignored by many.
- It won't be used by most of us for quite some time, unfortunately.
- When it does start appearing, we'll see more hybrid solutions. Code that uses Enumeration, Iterator, and the new for-each loop. Code that uses a mixture of casts and parameterized types. Code that uses combinations of enum constants, hard-coded psf constants, and hand-coded Bloch-safe object constants. Code that uses old and new ways of locking/synchronizing on objects. Code that doesn't use EnumMap when it should. Etc.

I have two disappointments with 5.0:
1. erasure
2. backward compatibility, which is the reason #1 exists. And I do understand the need for it.

Don't get me wrong, I really like the changes in 5.0, but the Java language has become pretty cluttered with deprecated ways to skin a cat. One day it would be nice if they started over again with a clean slate.

-j-
[ March 15, 2005: Message edited by: Jeff Langr ]
 
Horatio Westock
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see 5.0 as another step in the maturation of Java in much the same way the STL and Templates completely changed C++. As an observation, you still find many C++ coders writing horrendous code and reinventing the wheel.

As Jeff points out, there will certainly be a degree of hybrid styles in many multi-programer (and probably single programer) projects. But for those that take the time to understand and leverage the new features, 5.0 will offer much more elegant ways of working.
 
Herb Schildt
Author
Posts: 253
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeff:

Much of what you say I agree with. However, when you say


- The changes in J2SE 5.0 will be ignored by many.


I agree that some will try to ignore it, but because of generics most won't be able to.

The addition of generics changes Java in many ways. One way that can't be ignored is the fact that it causes a substantial number of the classes and methods in the API to be rewritten for generics. If you try to compile these classes/methods with non-generic code, warning errors will be reported.

Frankly, programmers who ignore generics will be left behind. And no one can afford to be left behind in the fast-moving world of Java programming.

Autoboxing is also hard to ignore because it changes the semantics of the language.
 
Jeff Langr
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Herb Schildt:
If you try to compile these classes/methods with non-generic code, warning errors will be reported.

Frankly, programmers who ignore generics will be left behind. And no one can afford to be left behind in the fast-moving world of Java programming.

Autoboxing is also hard to ignore because it changes the semantics of the language.



True on all counts. However, you won't see many programmers trying to create their own parameterized types. And many programmers won't bother using enums. Point being that 4 out of 5 developers won't care enough to know to use the newer features, or have too badly ingrained habits.

-Jeff-
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At my work we are very interested in 5.0. We have gone so far as to give classes about the new features available. However, because we have standardized on eclipse we won't be writing 5.0 code until eclipse 3.1 final is released (and even then it may take a bit to get everybody up to speed there are still some developers working in eclipse 2.1).

I see alot of interest and would suggest it's more along the lines of 4 out of 5 programmers will be using the newer features. Of course my 'poll sample' could be a bit narrow.
 
Jeff Langr
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm basing my stats on the fact that 4 out of 5 developers still use things like Vector unnecessarily.

-j-
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually I'm not so concern over Tiger's naming convention.

I'm more interested in knowing how widely had it been adopted by the industry. There's always a gap between new technologies & products that embraces them. How soon would BEA, Oracle, IBM & others non-open-source vendors come out with products that features Tiger?

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Herbert,

It will be interesting to read your new book. I took a class thru my company on the new features of Java 5 but one thing that was still kinda grey was annotations - It seems like you could break annotations into a 3 day class. I understand the basics but would like to know more. What are the pros and cons when using XDoclet to generate code versus using annotations? I could see where using annotations would be nice for generating EBJ classes - ie home and remote interfaces. I've searched the web for documentation and tutorials on annotations, and there really isn't a whole lot of details.

Overall, I really like the new features within Java 5.
Thanks!
Ryan
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

from what I understand this will become :


Enums are useful and somewhat intuitive, but will require a small amount of adjustment of thinking to start using them.

Generics will require a large mind-set adjustment, but offer the greatest potential.

I believe people will use :
1) the most intuitive new features first (for-in loop, autoboxing and enums).

2) Replace StringBuffers with StringBuilders, introduce Scanners and Formatters as they realise that benefits. These features are essentially upgrades to existing mechanisms, so there is only a little bit of learning to do and these can be replaced on a gradual basis.

3) Most programmers will recognise the value of VarArgs and Generics but will only invest the time in learning them when they have a need to use them.

Regards,

Fintan
[ March 16, 2005: Message edited by: Fintan Conway ]
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeff Langr:
I'm basing my stats on the fact that 4 out of 5 developers still use things like Vector unnecessarily.

-j-



Which is caused by 4 out of 5 developers learning Java using books designed for teaching the creation of applets that must run on 1.1 JVMs and never read anything else about the language...

The reason language features from the Tiger will be ignored is because people don't agree with the direction they're pulling the language towards (so political/religious reasons) in addition to that.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For me, I think I'll use generics (and associated autoboxing) and the new for loop quite a bit in my line of work, enums maybe once in a while, and the rest rarely if ever.
The annotations and printf functions will see no use, the first because I don't agree with them on fundamental principles (coupling code with comments, etc.) and the other because in my practice they make no sense (little use for printf in a web application using JSPs and logging APIs for all output that doesn't go to a mainframe or database).
Varargs methods I'm not yet sure of. Never saw much need for them when doing C++, don't see a need for them now but I'll keep them in mind for whenever they might come in handy.

Of course all that only after we can get some 1.5 JVMs for our target platforms...
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:

Of course all that only after we can get some 1.5 JVMs for our target platforms...



Thats the main problem for me, as soon as the jrockit works with 1.5 (5.0) then I'll be able to use it.

I think i'll be mainly using generics of all the new featers.

-Paul
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Our 1.5 version has been out since December 2004, the current update is "SP1". It's available here:

http://commerce.bea.com/products/weblogicjrockit/5.0/jr_50.jsp

Cheers!

Henrik St�hl, JRockit team
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Herb was here two months ago -- this is an old thread, ressurected by the advertisement posted above.
 
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic