Feedback and comments on ARM proposal - resend

Jeremy Manson jeremy.manson at gmail.com
Fri Mar 20 13:02:35 PDT 2009


On Thu, Mar 19, 2009 at 5:55 PM, Joshua Bloch <jjb at google.com> wrote:

> especially considering your disagreement with Howard and
>> Jeremy about declaration scope rather than a new block-structured
>> statement form,
>
>
> Not really a disagreement. In the end, we both came to the conclusion that
> block-structured was probably the right thing for Java today.
>

I really don't *want* to interject myself here, but in the interests
of clarity and not being misrepresented by anyone, I will say what I
actually think about the proposal.

I like it.

In an ideal world, in a language that we could start from scratch, I
would like declaration scoping.  Java is not such a language.  In
Java, nothing meaningful happens when variables go out of scope, other
than that they are not lexically available.  It doesn't even mean that
objects pointed to are now unreachable -- a compiler can decide to
make objects unreachable before the only variables pointing to them go
out of scope!  Having semantics for nested scopes is a C++-ism, not a
Java-ism.

I think it would be nice to have support for opening and closing
resources in a way that does not require you to declare a variable
(just as the standard for loop doesn't require you to declare a
variable in the initializer).  I don't think that that is actually all
that important by comparison with what the proposal provides, and I
believe it can be retrofitted later (potentially in a later Java
revision) if we decide it is necessary.  I think the biggest reason to
include it now is probably that everyone will be asking why we didn't
include it.

Jeremy



More information about the coin-dev mailing list