Re: Java Code Convention Guidelines question...
From: Chris Smith (cdsmith_at_twu.net)
Date: 01/06/04
- Next message: Chris Smith: "Re: New to Java couple ?'s"
- Previous message: Karsten Wutzke: "JAR files and manifest: Class-Path"
- In reply to: rkm: "Re: Java Code Convention Guidelines question..."
- Next in thread: rkm: "Re: Java Code Convention Guidelines question..."
- Reply: rkm: "Re: Java Code Convention Guidelines question..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 6 Jan 2004 09:38:41 -0700
rkm wrote:
> > That's not the issue. The issue is invoking a static method while
> > thinking that it is (and therefore expecting it to act like) an instance
> > method. Since the two behave in completely different ways, this could
> > add bugs to code very easily.
> >
> Again, show an example.
Okay. I fixed a bug about three or four months ago in which someone
called Thread.sleep using an instance reference, and expected it to put
a different thread to sleep. See? The instance method syntax caused
confusion, by implying that the method "sleep" acted on a specific other
instance, when it really doesn't.
I realize that's a little bit different from our conversation, which is
about whether a developer should intentionally pretend to act on some
specific object when they really aren't. Doing so intentionally is so
strange and twisted, though, that I can't possibly think of any sort of
realistic example of someone doing so; so I'm resorting to an example of
accidentally doing so to show how confusing it is.
> Let's not confuse things by extending the argument to "any
> arbitrary change". No-one said that.
Right. I'm *trying* to prompt you to tell me why you think that
instance and static methods ought to be interchangable... but you're not
taking the hint. So why is it?
-- www.designacourse.com The Easiest Way to Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
- Next message: Chris Smith: "Re: New to Java couple ?'s"
- Previous message: Karsten Wutzke: "JAR files and manifest: Class-Path"
- In reply to: rkm: "Re: Java Code Convention Guidelines question..."
- Next in thread: rkm: "Re: Java Code Convention Guidelines question..."
- Reply: rkm: "Re: Java Code Convention Guidelines question..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|