dr_tectonic: (Default)
[personal profile] dr_tectonic
You know, if you could just call null.toString() and have it return "null" instead of throwing an exception, in exactly the way it behaves when you call "some string "+null, I would hate Java so much less...

Date: 2004-12-07 02:24 pm (UTC)
From: [identity profile] toosuto.livejournal.com
that is lame.

Date: 2004-12-07 02:59 pm (UTC)
navrins: (Default)
From: [personal profile] navrins
That would be nice.

(Currently wrestling with javax.swing.undo.*)

Date: 2004-12-07 03:19 pm (UTC)
From: [identity profile] dr-tectonic.livejournal.com
!?! Bleeeeaah! Beemer.setEnvy(bcb, false);

Date: 2004-12-07 03:02 pm (UTC)
From: [identity profile] eto-theipi.livejournal.com
Where do you go from there? Should null support the entire API for Object? What if I want to override the default NullObject's to.String() behavior? Can I set null = myObject? Madness!

Date: 2004-12-07 03:15 pm (UTC)
From: [identity profile] dr-tectonic.livejournal.com
Well, if we got rid of primitives entirely, null would be an Object just like everything else.

It wouldn't be extensible, so you couldn't inherit/override, and of course you can overwrite any reference to null, but it's probably a lot easier to just look at smalltalk and objective-c to figure out what the right answers to such questions are.

But, it's the *best*

Date: 2004-12-07 03:29 pm (UTC)
From: (Anonymous)
[sarcasm font|Scott voice enabled] Java's *perfect*? Why would you use *any* other language? Are you mad? And, nobody uses Perl, that's the silliest language *ever.*[/sarcasm/Scott]

Sorry. Had a flashback...

k8

Date: 2004-12-07 03:42 pm (UTC)
From: [identity profile] eto-theipi.livejournal.com
But wouldn't it be neat to be able to call null.getClass() and start adding methods? Fun!

Date: 2004-12-07 09:59 pm (UTC)
From: [identity profile] flwyd.livejournal.com
There is, of course, the school of thought which says you should create static NULL objects for your classes and use those. Then you can wrap String in a class with your own convenience methods.

Date: 2004-12-07 10:20 pm (UTC)
From: [identity profile] dr-tectonic.livejournal.com
I call that an abuse of the word "convenient".