Re: Discovering variable types...

From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: 08/10/04


Date: Tue, 10 Aug 2004 10:19:27 +0200


<not@any.adr> wrote in message
news:ntpfh090fkgodqiask2s2l91hs432cjito@4ax.com...
> On 09 Aug 2004 20:34:22 GMT, vbdis@aol.com (VBDis) wrote:

>> Such functions already exist,
>
> I guess you missed the part where we all agreed they don't.

Speak for yourself, please.

Your code starts with "procedure sizes(var X);" and then wants
to use information that isn't there and do things that consequently
can't be done. DoDi very correctly points out that if you use the
correct mechanism for what you're trying to achieve, it's _not_
impossible and you can get what you want with ease. You just have
to give up the notion that type information is irrelevant or can be
plucked from thin air, to wit an untyped parameter. Pass a variant,
pass an array of const; you'll have no problem. Think of _what_ you
want to do first, not how.

What it comes down to is that you've set a goal, decided on a means,
and come complaining that some unrecognisable subdivision of the
means make it hard to attain some unrecognisable subdivision of the
goal - without questioning the means, either in part or as a whole.
If you find out you've chosen the wrong means, _take a step back_ and
try again. (This is almost the "don't do Y to reach X, do Z to reach W"
argument from that brilliant old post to which a reference was recently
posted.)

> Some said it was for good reasons.
> Others, me particularly, said it might be helpful in some cases.

And there are good reasons and _what_ you want to do can be done. The
mechanisms are in place, finding fault with other mechanisms for not
being able to do the same is simply misguided. Those other mechanisms
were designed to do other things.

> You see that's what *programming* [...] is all about. Expanding and
> redefining the limits and capabilities of a system is why Pascal was
> created in the first place,

Actually, teaching people programming was why Pascal was created.
Not that it matters; Object Pascal is a useful language for general
programming and Delphi is a useful tool for visual *or* non-visual
Windows development.

> it's a shame this pioneering tradition has been reduced to a bunch of
> .lib modules listed in records and triggered by a near-totally invisible
> event mechanism. Pascal was never about scripting... it was born to
> teach *programming*, grew to enable some really advanced work and now
> it's become nothing more than the undercurrent driving a bloated
> scripting engine.

I'll grant you that Delphi isn't nearly as useful without the VCL source.
But you can get it and that makes the event mechanism somewhat less than
"near-totally" invisible.

And I totally resent the implication that Delphi is useful only for
development by dragging components onto designers. That's just not true.
Every developer worth his or her cookies can *write* components, and
you may take that personally.

> I don't begrudge people using this nor do I think it's necessarily a
> bad thing... but I don't fathom why someone who chooses NOT to go that
> way gets frowned upon.

Because you're doing it for the wrong reasons. You reject the entire
concept of object-orientation because you don't want to pay its cost
and don't care for its benefits. All the while you, too, could be
writing code where the algorithm is cleaner, better isolated, more
robust, more expandable, and more maintainable, at the cost of linking
in fifty thousand lines of code that have already been debugged and
that you never have to look at. Or forego the visual stuff and not
even link in the Forms unit, without giving up the advantages of OO
design.

All that said, I know there's a difference between systems programmers
and applications programmers, and you are the one and I am the other,
and all the same rules _don't_ apply. Our priorities just aren't the
same, and in a way it's great that we can both do what we want with
the same Delphi. But for as long as you keep telling us what's wrong
with the way we do things, I'll keep telling you about how there are
benefits to it, too, and they may be more important than the costs to
some people.

And it doesn't help that you keep mowing down straw men in order to
demonstrate what _can't_ be done.

Groetjes,
Maarten Wiltink



Relevant Pages

  • Re: Delphi 2005 upgrade 2... not recommended
    ... > I can't imagine what Delphi would cost under such circumstances. ... some people would finaly have to learn programming. ... Martin ...
    (borland.public.delphi.non-technical)
  • Re: home made home security
    ... to interface to the RS485 master circuit. ... You do understand that the "master circuit" in this case needs to be a PC, ... What is the value of your time spent programming that you would ... Home security automation systems _don't_ cost thousands of dollars if you ...
    (comp.home.automation)
  • Scope of Procedures Follow-up
    ... I started programming in the late 1980s with GFA Basic ... a brilliant event driven programming language for the time. ... OS/2, so my next PC was another dual boot machine with OS/2 version 4. ... I had heard of Delphi and found a copy of version 6 on an old Australian PC ...
    (alt.comp.lang.borland-delphi)
  • And now my thoughts on Delphis survival
    ... The first programming language I ordered was Turbo ... Had TP 1.0 been $1,200.00 I would probably not be a Delphi ... DevCo should bring back the Standard Edition ... the choice must be made between .NET and the new BASIC compiler, ...
    (borland.public.delphi.non-technical)
  • Re: Cant pass dynamic arrays to procedure without EInvalidPointer exception
    ... IMO it is safer and easier to ask the Array for its dimensions ... Equations" app is actually a Delphi rewrite of an old ALGOL program ... strictly sequential Von Neumann programming, ... the really cool thing about ordinal types is that you can use ...
    (comp.lang.pascal.delphi.misc)