Monday Oct 06, 2014

Lambda Q&A Panel

By Guest Blogger Bob Larsen, Java.net editor

Stuart Marks, principal member of technical staff at Oracle, facilitated a fantastic discussion about lambda expressions during JavaOne. A panel of gurus offered their diverse perspectives and answered questions about lambdas submitted via Twitter. The panel included Maurice Naftalin, principal developer at Morningside Light; Brian Goetz, Java language architect at Oracle; Raoul-Gabriel Urma, a PhD candidate at the University of Cambridge; David Blevins, founder of Tomitribe; and Trisha Gee, Java engineer at MongoDB.

The panel opened with Urma, Naftalin, and Goetz discussing the inclusion of functional programming features, via lambdas and streams, into the Java language. The inclusion of these features allows Java developers access to these features without changing the nature of the language itself, they said.

Gee then described how MongoDB is moving toward the inclusion of lambdas and streams without losing compatibility with earlier versions of Java. This can be accomplished, she said, by exposing single-method interfaces and stream-like APIs, which both allow and encourage those using the library to use these new features without requiring the library itself to be compiled against older versions of Java.

Later, the discussion turned to when it is and is not appropriate to use lambdas. The panelists discussed how passing blocks of code longer than a single line into a lambda expression can easily make the lambda expression difficult to read and maintain. Method references allow the use of lambdas in these situations without reducing code clarity.

Because the Stream API makes parallelism so easy to implement, there is a great concern that it will be overused. “The problem with parallelism is that it’s too easy. You can just plunk it in there, and people see it as a magic incantation for extra speed,” said Gee. The panel quickly reached consensus that initially people will overuse it, and that there is no substitute for proper testing and benchmarking in a production-like environment. Goetz also pointed out that there is an extreme focus on performance, and reminded the audience that there is no reason to even think about performance tuning unless there is a business reason to do so. Frequently, the simple and easily understood code runs fast enough to meet the requirements, he said.

The conversation also ventured into the weaknesses in the current lambdas feature, mostly around exceptions. Checked exceptions do not play well with lambdas. One suggestion was simply to make the lambda expression throw an exception. Goetz explained that this was considered in the crafting of the spec. He said it is really a bad idea; it would require every lambda expression to be surrounded by a try-catch block, the catch statement must catch all exceptions, and the loss of precision should make us all “feel dirty.” Another potential problem is exception reporting; stack traces involving lambdas can be quite confusing to those not familiar with them.

The discussion closed with the panelists encouraging the audience to use Java 8—even if it is only in nonproduction situations, such as writing tests. They also pointed out that many Java developers will be learning a new programming paradigm and that they shouldn’t avoid using these features just because they don’t want to make mistakes.


Monday Sep 15, 2014

JavaFX, Carputer and Lambdas with Simon Ritter

Simon Ritter, an Oracle Java Technology Evangelist who is renowned for his entertaining and informative JavaOne sessions, has been in the IT business since 1984 and holds a Bachelor of Science degree in Physics from Brunel University in the U.K. 



Originally working in the area of UNIX development for AT&T UNIX System Labs and then Novell, Simon moved to Sun Microsystems in 1996 where he started working with Java technology both in technology development and consultancy. At Oracle, he now focuses on the core Java platform and Java for client applications. He also continues to develop demonstrations that push the boundaries of Java for applications like gestural interfaces.

[Read More]

Tuesday Jul 22, 2014

Sharpen your Skills with Java University!

Attend a full day of Java University on Sunday, September 28th. Stay ahead of the game even before the conference begins  

The Java University training is an intensive crash course to get you up to speed with Java. Designed for beginner or experienced developers, the training is taught by experienced technologists and trainers. Boost your skills and stay on top of changes in Java 8, Internet of Things, web applications and more.  

The topics are: 
•    Architect and Design Secure Robust Enterprise Java Applications for the Cloud and Beyond
•    Develop Java Oracle Embedded Applications Using Raspberry Pi (Internet of Things)
•    Diving into Ruby on Rails
•    Diving into Scala
•    Java EE 7 from an HTML 5 Perspective: HTML5, WebSocket, JSON, and JSF
•    Java 8 Lambda Expressions
•    Java Performance Tuning
•    JavaScript for Java Developers: Develop Web Applications 
•    The Latest and the Greatest RESTful Web Services

Learn more about these sessions by visiting Java University

Tuesday Sep 24, 2013

Session Report: JSR 341: Expression Language 3.0

Technical Session Report: JSR 341: Expression Language 3.0
[Read More]

Friday Sep 13, 2013

Simon Ritter Prepares to Show off Java SE 8 at JavaOne

Oracle’s Simon Ritter has more tricks up his sleeve with cars and hand-tracking devices. [Read More]

Thursday Sep 27, 2012

Talking JavaOne with Rock Star Martijn Verburg

Learn about Java Rock Star Martijn Verburg. He has, in recent years, established himself as an important mover and shaker in the Java community.
[Read More]
About

javeone logoJavaOne Conference 2014 Content

San Francisco, USA: Oct 25 - 29, 2015

São Paulo, Brazil: June 23 - 25, 2015

Links

Search

Archives
« April 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
22
23
24
25
26
27
28
29
30
  
       
Today