Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25659
| From | Lew <noone@lewscanon.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Why “new”? |
| Date | 2011-02-08 07:48 -0500 |
| Organization | albasani.net |
| Message-ID | <iire1f$987$1@news.albasani.net> (permalink) |
| References | <iii71v$3ud$1@lust.ihug.co.nz> <lq60l6p3aamn6jjq00271g3mmunebt01if@4ax.com> <4d508054$0$23755$14726298@news.sunsite.dk> <iiq27v$flt$3@news.albasani.net> <iiqikh$7cj$1@news.eternal-september.org> |
Roedy Green wrote: >>>> Java has almost no syntactic sugar other that for:each which came >>>> quite late in the game. The creators of Java were system programmers. Lew wrote: >> Yet what it does have is so sweet! Maybe it doesn't need more sugar. Mike Schilling wrote: > A fair amount of what was added in Java 5 (generics aside) was syntactic sugar: > > * Variable-parameter functions > * Autoboxing > * The enhanced for loop > > The last of these is one of my favorite things in the whole language. for ( int ix = 0; ix < limit; ++ix ) is syntactic sugar for a 'while' loop. '+=' is syntactic sugar for "add and assign". '?:' is syntactic sugar for a simple 'if/else'. Leaving implicit the default constructor or the 'super()' call at the top of a constructor are syntactic sugar. Auto-initialization of member fields to their zero-like value is syntactic sugar. 'synchronized' is syntactic sugar for taking out (and releasing!) a lock on a monitor. 'import' is syntactic sugar for FQNs. Yeah, Roedy, Java has almost no syntactic sugar! -- Lew Ceci n'est pas une fenêtre. .___________. |###] | [###| |##/ | *\##| |#/ * | \#| |#----|----#| || | * || |o * | o| |_____|_____| |===========|
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Why “new”? "Mike Schilling" <mscottschilling@hotmail.com> - 2011-02-07 21:00 -0800 Re: Why “new”? Lew <noone@lewscanon.com> - 2011-02-08 07:48 -0500
csiph-web