Primitives are good... if you're a CPU.  I have absolutely no objection to
the performance benefits of primitives in bytecode (in the earlier pre-JIT
interpreters at least, the benefit is less clear in a post-JIT world).

But what's in bytecode for the benefit of the compiler needn't be what's in
the language for the benefit of programmers.  A translation in javac would
allow Java to have pure objects whilst maintaining primitives in bytecode;
just as javac allows us to create inner classes, even though the underlying
platform has no idea of the concept.  We *can* have our cake and eat it too.

As for why it's right for everything to be objects?  It's a far cleaner,
more elegant, and a more internally consistent model for programmers to
reason about.  The very existence of this thread illustrates why that's
important!

To quote: "premature optimisation is the root of all evil", and you can't
get much more premature than in the design of a language...




On 11 March 2012 19:38, Fabrizio Giudici <[email protected]>wrote:

> On Sun, 11 Mar 2012 18:23:45 +0100, Cédric Beust ♔ <[email protected]>
> wrote:
>
>  On Sun, Mar 11, 2012 at 10:09 AM, Kevin Wright <[email protected]>
>> **wrote:
>>
>>  I'd say smalltalk (a 70's language) had it right, make *everything* an
>>> object.
>>>
>>
>>
>> Define "right". I used a lot of Smalltalk during my PhD in the early 90's
>> and while the environment was revolutionary on many fronts, it was also
>> very, very slow (both the IDE and the programs it created). I'd argue that
>> one of the many reasons for this was because everything was an object.
>>
>
> In fact SmallTalk, from the industrial point of view, is a failure.
> Fortunately Java has got non-object primitives and it allows to do number
> crunching. All this discussion originates from a typical programmer's error
> blaming the language, and for controlling that error we've got plenty of
> tools, as if it was the only error that programmers do in Java.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to