InfoQ

Interview

Joshua Bloch on Closures, Resource Management, Google

Interview with Joshua Bloch on Nov 07, 2006

Community
Java
Topics
Programming
Tags
Java SE ,
Closures ,
Language Features
Summary
Core Java language designer Joshua Bloch talks about the need for Closures, Functional Programming, Java's need for better resource management, Java Puzzlers, and cool stuff Google is doing with Java. Recorded at www.javazone.no conference, Norway's best Java conference.

Bio
Joshua Bloch is a Principal Engineer at Google. He led the design and implementation of numerous Java platform features, including the Java Collections Framework. He is the author of the Jolt Award-winning book Effective Java. He holds a Ph.D. in Computer Science from Carnegie-Mellon University and a B.S. in Computer Science from Columbia.
Josh can you tell us a bit about yourself and what you are doing at Google these days?
Are you still heavily involved with Java's evolution even though you're at Google?
What's going on in Java these days that excites you?
Where do you stand on the closures debate?
So Java itself should not approach more functional programming style?
What else do you think Java needs from a language perspective?
About the resource management idea: what are the use-cases for this, why do we need it?
As the Java platform becomes multi-lingual, how do you see the standards bodies functioning and the platform itself evolving?
Now that you're not at Sun anymore. Can you give us your honest opinion on how you think open-source java should be governed?
If you were all powerful and you could change two things about how Java evolved over the last 8-9 years what would you change?
What is Google doing with Java?
Can you tell us more about this awesome Java infrastructure at Google?
What's new with Puzzlers?
What's your favorite puzzle?
show all  show all
Using block for Java by Jonathan Allen Posted Nov 8, 2006 12:40 PM
The Reference Puzzle by Scott Gelb Posted Nov 8, 2006 9:13 PM
Thumbs up for the text ! by ZedroS Schwartz Posted Nov 9, 2006 1:56 PM
Listening to Josh by Alex Popescu Posted Nov 11, 2006 6:59 AM
Resourcing Problem. by Geoffrey Wiseman Posted Nov 13, 2006 10:28 AM
a using()-like block for Java by Roger Voss Posted Nov 24, 2006 11:15 AM
  1. Back to top

    Using block for Java

    Nov 8, 2006 12:40 PM by Jonathan Allen

    I really like this idea, but as the Joshua says it needs to have more than one resouce on the same line. I don't think this would be hard, as VB does it with its Using block.

  2. Back to top

    The Reference Puzzle

    Nov 8, 2006 9:13 PM by Scott Gelb

    In case anyone is interested, in the last part of the interview Dr. Bloch makes a reference to Puzzle 85: Lazy Initialization (pg. 205 of Java Puzzlers).

  3. Back to top

    Thumbs up for the text !

    Nov 9, 2006 1:56 PM by ZedroS Schwartz

    Hi

    That's great you put a written translation of the interview. Good on you !

    Cheers,
    ZedroS

  4. Back to top

    Listening to Josh

    Nov 11, 2006 6:59 AM by Alex Popescu

    Listening Josh speaking is always an amazing experience. The resource auto-manageable blocks sounds very well and I would definitely be happy to have something like this as soon as possible. Even if I haven't hit myself many of the "issues" Josh would have theoretically changed, still just thinking about them make you see things pretty different.

    Excellent interview!

    ./alex
    --
    .w( the_mindstorm )p.

  5. Back to top

    Resourcing Problem.

    Nov 13, 2006 10:28 AM by Geoffrey Wiseman

    Completely agree that the resourcing problem is one that Java needs a better solution for, which is definitely something that Closures are used for in other languages. Ruby's full of idioms like this where you 'use' a connection with a block, rather than opening, doing stuff, then closing, and catching.

  6. Back to top

    a using()-like block for Java

    Nov 24, 2006 11:15 AM by Roger Voss

    The thing about C# using() is that it only works with objects that implement IDisposable interface. There is no similar universal interface in Java for standardizing the cleanup of non-memory resources. The various resources that one might want to subject to such a language construct in Java have varying conventions as to what to invoke.

    So in the end there might need to be a way to associate a closure in which one places the code that invokes whatever method does cleanup operation.

    Also if this new feature is made to work with multiple resources, then how does this new construct insure that each resource cleanup method gets invoked (i.e., how to automatically deal with the potential of a given cleanup method to throwing an exception)?

    If closures are introduced as part of the solution for this, there is possibility that a cleanup method throws a checked exception so the closure must deal with that. I'd prefer not to have to wrap calls in try/catch - hopefully a new construct for cleaning up deterministic resources could automate dealing with this concern.

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.