The Artima Developer Community
Sponsored Link

Java Buzz Forum
Beyond average: 10 best practices for coding Java APIs

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
News Manager

Posts: 47623
Nickname: newsman
Registered: Apr, 2003

News Manager is the force behind the news at Artima.com.
Beyond average: 10 best practices for coding Java APIs Posted: Sep 3, 2014 3:28 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by News Manager.
Original Post: Beyond average: 10 best practices for coding Java APIs
Feed Title: JavaWorld
Feed URL: http://www.javaworld.com/index.rss
Feed Description: JavaWorld.com: Fueling Innovation
Latest Java Buzz Posts
Latest Java Buzz Posts by News Manager
Latest Posts From JavaWorld

Advertisement

Published around this time last year, jOOQ creator Lukas Eder's Java programming best practices are written as a series of caveats to the standard wisdom of API design. Eder writes: "Being an internal DSL, jOOQ challenges Java compilers and generics to the max, combining generics, varargs and overloading in a way that Josh Bloch probably wouldn’t recommend for the 'average API.'"

Digging into the "beast" that is Java, Eder emerges with some perennial best practices -- "It often makes sense to free memory in the inverse order of allocation"; "Avoid returning anonymous, local or inner class instances from methods to the outside scope"; "Arrays or Collections should never be null" -- and a handful related to new features in Java 8 (see his comments on using defender methods, Optional, and single abstract methods). More controversially, Eder takes on the question of whether it's ever safe to make methods final by default:

To read this article in full or to leave a comment, please click here

Read: Beyond average: 10 best practices for coding Java APIs

Topic: IntelliJ IDEA 14 EAP 138.1980.1 is Out Previous Topic   Next Topic Topic: Big Java News in Late Summer 2014

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use