• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

New features announced for Java 8

 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oracle announced today that they are adding several new operators to the Java language.

One of the more interesting is the "approximator" operator, designed for specifying an estimated range. The syntax has two forms:
  • a(+-)b, which reads "a plus or minus b"
  • a(+-)b%, which reads "a plus or minus b percent"


  • These instantiate a new instance of javax.af.Range (another addition to the API), which has conveniently overridden toString. For example...
    The output (under Java 8.0.1 Beta) is...
    Range: (93, 107)
    Range: (88, 112)



    But even more fundamental is this change to the language...

    Due to continuing confusion regarding postfix operators, an explicit operator cast will be required in Java 8 to force traditional postfix behavior. In the absence of such a cast, the postfix operator will default to prefix operator behavior.


    For example...

    This will break a lot of existing code, but the benefits are obvious.

    Edit: Corrected minor inaccuracy.
     
    Ranch Hand
    Posts: 541
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    A looong post but no reference. Something is not right here.
     
    Sheriff
    Posts: 67747
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Even more exciting for those of us in the UI space is the addition of the AdmonishUser interface to the java.util library.

    Methods is this interface are intended to alert the user when some action has been taken that should be dissuaded; for example, repeatedly performing the same action and expecting something different to happen.

    The actual implementation of these methods are implementor-defined, but most implementors seem to favor an electric arc across the keyboard. For mobile environments, the release of curare gas has been discussed.

    The proposed Javadoc for this interface goes to pains to point out that use of the interface does not indemnify the developer against wrongful death lawsuits.

    The interface will also be available in the Applet environment for use on the web, and likely built into modern browsers as a new CSS property.
     
    marc weber
    Sheriff
    Posts: 11343
    Mac Safari Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bear Bibeault wrote:...most implementors seem to favor an electric arc across the keyboard...


    The theory is that programmers who repeatedly perform the same action expecting a different result have already demonstrated a predisposition to enjoying electric shock. Therefore, the shock should reinforce such behavior, putting them in an infinite loop of performing the same (incorrect) action, thus effectively removing them from the programming pool.
     
    marc weber
    Sheriff
    Posts: 11343
    Mac Safari Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Saurabh Pillai wrote:A looong post but no reference. Something is not right here.


    Sorry, here's the link...

    http://www.oracle.com/java/javase/8/beta/newFeatures.jsp
     
    Sheriff
    Posts: 3063
    12
    Mac IntelliJ IDE Python VI Editor Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bear Bibeault wrote:Even more exciting for those of us in the UI space is the addition of the AdmonishUser interface to the java.util library.



    Test-driven development (TDD) is being revised to Red-Green-Admonish User. (The Green step is optional.) Quite a few pioneering developers adopted this methodology years ago. I know because I use their software all the time.

    Another addition to Java 8 is the method System.crashForNoReason(), which has been available in all Microsoft stacks since the very first version of Windows.
     
    Master Rancher
    Posts: 4830
    74
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Not Java, but you guys may like the AffirmIt test framework for Ruby.
     
    Mike Simmons
    Master Rancher
    Posts: 4830
    74
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    New from Atlassian: Angry Nerds
     
    Bear Bibeault
    Sheriff
    Posts: 67747
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Mike Simmons wrote:New from Atlassian: Angry Nerds


    Now that is funny!
     
    Mike Simmons
    Master Rancher
    Posts: 4830
    74
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Be sure to try to buy some of their merchandise.
     
    Bear Bibeault
    Sheriff
    Posts: 67747
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I would totally buy that T-shirt!
     
    marc weber
    Sheriff
    Posts: 11343
    Mac Safari Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bear Bibeault wrote:I would totally buy that T-shirt!


    ...at least for the diversion of filling out their order form.
     
    Saurabh Pillai
    Ranch Hand
    Posts: 541
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    where one gets to see the t-shirts?
     
    Mike Simmons
    Master Rancher
    Posts: 4830
    74
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Saurabh Pillai wrote:where one gets to see the t-shirts?


    At the bottom of the Angry Nerds page. There's just one shirt, and we can't see it very clearly. But like Bear, I would definitely be willing to buy a shirt. And a "bugs nerd" plushie. And maybe even a "front end nerd" plushie - for Bear.

    I suspect that if we never see the shirt and plushies actually for sale (for real), it would be because Atlassian does not want to risk a trademark infringement lawsuit from the makers of Angry Birds. But still, it could happen. Angry Birds could just laugh and see it as free advertising for their product, sort of. And Think Geek has many products that started as April Fools gags, that later became real products.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic