wood burning stoves*
The moose likes Meaningless Drivel and the fly likes New features announced for Java 8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "New features announced for Java 8" Watch "New features announced for Java 8" New topic
Author

New features announced for Java 8

marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

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.


    "We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
    sscce.org
    Saurabh Pillai
    Ranch Hand

    Joined: Sep 12, 2008
    Posts: 509
    A looong post but no reference. Something is not right here.
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61433
        
      67

    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.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    marc weber
    Sheriff

    Joined: Aug 31, 2004
    Posts: 11343

    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

    Joined: Aug 31, 2004
    Posts: 11343

    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
    Greg Charles
    Sheriff

    Joined: Oct 01, 2001
    Posts: 2854
        
      11

    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.
    Mike Simmons
    Ranch Hand

    Joined: Mar 05, 2008
    Posts: 3018
        
      10
    Not Java, but you guys may like the AffirmIt test framework for Ruby.
    Mike Simmons
    Ranch Hand

    Joined: Mar 05, 2008
    Posts: 3018
        
      10
    New from Atlassian: Angry Nerds
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61433
        
      67

    Mike Simmons wrote:New from Atlassian: Angry Nerds

    Now that is funny!
    Mike Simmons
    Ranch Hand

    Joined: Mar 05, 2008
    Posts: 3018
        
      10
    Be sure to try to buy some of their merchandise.
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61433
        
      67

    I would totally buy that T-shirt!
    marc weber
    Sheriff

    Joined: Aug 31, 2004
    Posts: 11343

    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

    Joined: Sep 12, 2008
    Posts: 509
    where one gets to see the t-shirts?
    Mike Simmons
    Ranch Hand

    Joined: Mar 05, 2008
    Posts: 3018
        
      10
    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.
     
     
    subject: New features announced for Java 8