Re: What databases have taught me

From: Chris Smith <cdsmith_at_twu.net>
Date: Sun, 2 Jul 2006 18:22:21 -0600
Message-ID: <MPG.1f12112b198818fa989737_at_news.altopia.net>


Robert Martin <unclebob_at_objectmentor.com> wrote:
> On 2006-06-30 20:44:16 -0500, Chris Smith <cdsmith_at_twu.net> said:
> > I don't find it particularly compelling to distinguish this/self from
> > instance fields in that way, especially since the distinction appeals
> > primarily to implementation rather than the actual meaning of what's
> > going on. I could very easily implement C++ in such a way that 'this'
> > remains constant regardless of its static type in terms of the
> > inheritance hierarchy. The only thing I'd lose is a bit of performance
> > in metghod dispatch.
>
> You'd also lose a bit of performance in accessing fields.

Right.

> What's more, I'm not sure the language would be C++ any longer; though
> I'm not sure of that.

I'm not at all where any doubt would come from. If the language behaves exactly like C++, then it's C++. I have never read the C++ language specification, but I'll nevertheless mail you $50 if you can point out where the specification *normatively* requires that implementations must add offsets to memory addresses to implement multiple inheritance. Just having the slightest inkling of what it means to specify a programming language convinces me that, assuming the C++ standardization committee wasn't made up of morons, that statement isn't there. Of COURSE a language with a different implementation is still C++.

(Note: There is almost certainly a set of statements to the effect that pointers to an object need not compare equal to each other if the pointers have different types, or something like that. That's not the same thing as requiring that the compiler add offsets to memory addresses. That's simply allowing such an implementation.)

(Note 2: Even if the statement is there, after I mail you $50, I will still remain doubtful that this actually disqualifies a different implementation from being C++. Language specifications are still generally read as specifying behavior rather than implementation; the existence of a formal model for that behavior -- even one so braindead as to mention offsets to memory addresses -- isn't binding on implementation, so far as the observable characteristics of that model are preserved.)

> > Wouldn't it be quite the opposite? I've never heard a Smalltalker go
> > on about instance variables.
>
> I actually learned the term (in 1985) from the Smalltalk-80 book which
> created the distinction between instance-variable and class-variables.
> The C++ vocabulary is "member variable".

Interesting... I guess it shouldn't be surprising that there are different subsets of language and jargon even within programming languages.

-- 
Chris Smith - Lead Software Developer / Technical Trainer
MindIQ Corporation
Received on Mon Jul 03 2006 - 02:22:21 CEST

Original text of this message