Re: Multi Dimensional Array Reallocation ?
- From: "Skybuck Flying" <nospam@xxxxxxxxxxx>
- Date: Fri, 12 Aug 2005 22:28:19 +0200
"Rob Kennedy" <me3@xxxxxxxxxxx> wrote in message
news:3m1vquF148ee1U1@xxxxxxxxxxxxxxxxx
> Skybuck Flying wrote:
> > "Bruce Roberts" <ber@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:T1OKe.17987$6d4.1241582@xxxxxxxxxxxxxxxxxxxxxxxx
> >> Less and faster code. Compile time binding eliminates the need for
testing
> >> instance types on each reference, and the need to store class symbol
> >> tables.
> >
> > Ok, the 80486 era is behind us, time to move on an harness the power of
the
> > Pentium 4's and Athlon X2's ;)
>
> Harness? Perhaps you mean _abuse_. That's what it would mean, for each
> reference to a field, method, or property to search the symbol table of
> the run-time type of the object to see whether there's another member by
> the same name at a closer scope than the one that was available at
> compile time.
>
> > The typecast is only needed to help the compiler along. This information
is
> > in fact already in the runtime information.
>
> Only for published properties and published methods. For arbitrary
> object members, the information is *not* in the run-time system to bind
> a name to one of those members. See for yourself by experimenting with
> the MethodAddress and FieldAddress methods, introduced in TObject.
>
> > So there is really no need for
> > the programmer to specify this information again and again and again and
> > again etc.
>
> So only specify it once. Assign the base-class variable to a
> descendant-class variable with a type cast, and use the descendant
> variable thereafter. When measuring run-time speed, that will amount to
> a single 32-bit assignment statement, which is both fast and compact.
>
> > Ok maybe I was a little harsh. Delphi has done a fine job throughout the
> > years, but as time comes change comes :D
>
> Then maybe it's time to change languages. Have you tried Smalltalk?
> Lisp? Javascript?
>
> >> Besides, what you want to do leads, eventually, to poor and difficult
to
> >> maintain software. It certainly eliminates much of the protection
offered
> >> by limited identifier scopes.
> >
> > It would free the programmer from these stinking limitations where the
> > fields of the true object can not be accessed via abstract classess. The
> > programmer knows what he is doing.
>
> You're giving the programmer far too much credit.
>
> > In case of doubt he could implement
> > necessary checks himself to see if objects are truely of a certain type.
>
> Why do that, when the compiler can already do it?
>
> >> I suggest that you try really hard to use the Delphi programming
framework
> >> as it was intended. Trying to fit a language to a design isn't worth
the
> >> effort. It makes much more sense to fit a design to the language. If it
> >> can't be done, then change to another language.
> >
> > It's not about a design.
>
> Design is everywhere.
>
> > The link design just illustrates the absurdity of
> > the typecasts.
>
> What link?
>
> > Delphi is full of examples with abstract class reference variables and
then
> > needing to do the damn typecasts again...
> >
> > Have you ever seen this:
> >
> > Button1Click( Sender : Tobject ) ;)
>
> Of course. And I suppose you think that means Sender is always a
> reference to a TButton. But have you ever seen an event of that name
> assigned to the OnClick event property of a TLabel? I have.
>
> > While I'll admit I rarely use the Sender abstract class anyway... maybe
it's
> > just too damn abstract ;) :)
>
> Sender isn't a class. And TObject isn't abstract.
Just for the record:
>From the delphi help
"
Note: TObject is never directly instantiated. Although it does not use
programming language features that prevent instantiation, TObject is an
abstract class.
"
Bye,
Skybuck.
.
- References:
- Multi Dimensional Array Reallocation ?
- From: Skybuck Flying
- Re: Multi Dimensional Array Reallocation ?
- From: Bruce Roberts
- Re: Multi Dimensional Array Reallocation ?
- From: Skybuck Flying
- Re: Multi Dimensional Array Reallocation ?
- From: Rob Kennedy
- Re: Multi Dimensional Array Reallocation ?
- From: Skybuck Flying
- Re: Multi Dimensional Array Reallocation ?
- From: Bruce Roberts
- Re: Multi Dimensional Array Reallocation ?
- From: Skybuck Flying
- Re: Multi Dimensional Array Reallocation ?
- From: Bruce Roberts
- Re: Multi Dimensional Array Reallocation ?
- From: Skybuck Flying
- Re: Multi Dimensional Array Reallocation ?
- From: Rob Kennedy
- Multi Dimensional Array Reallocation ?
- Prev by Date: Re: Multi Dimensional Array Reallocation ?
- Next by Date: Re: Multi Dimensional Array Reallocation ?
- Previous by thread: Re: Multi Dimensional Array Reallocation ?
- Next by thread: Re: Multi Dimensional Array Reallocation ?
- Index(es):