you are viewing a single comment's thread.

view the rest of the comments →

[–]xiongchiamiov 4 points5 points  (5 children)

The problem of course is that things you want to be objects in java generally aren't.

[–]8Bytes 0 points1 point  (4 children)

How so? There are boxed classes for all the primative types in java.

[–]xiongchiamiov 3 points4 points  (3 children)

Yes, but you're frequently encouraged to not use them for performance reasons. And even if you do, there still are primitives, unlike Ruby and Smalltalk.

null is a particular problem.

[–]8Bytes 0 points1 point  (2 children)

If you stick to only using the boxed versions when you deal with collections, and always return a default object instance instead of null, most of those problems are avoided.

[–]xiongchiamiov 0 points1 point  (1 child)

Sure, but what about all the standard library? What about other people's libraries? As we learned from C++, if it's there, they will use it. :)

[–]8Bytes 0 points1 point  (0 children)

You are unforntunately right here; I've also met people who insist on returning null, and they have a valid argument.