Re: Discovering variable types...
From: Bjørge Sæther (bjorge_at_hahaha_itte.no)
Date: 08/13/04
- Next message: Bjørge Sæther: "Re: Discovering variable types..."
- Previous message: Bjørge Sæther: "Re: Discovering variable types..."
- In reply to: Marco van de Voort: "Re: Discovering variable types..."
- Next in thread: David Reeve: "Re: Discovering variable types..."
- Reply: David Reeve: "Re: Discovering variable types..."
- Reply: Marco van de Voort: "Re: Discovering variable types..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 13 Aug 2004 15:25:30 +0200
Marco van de Voort wrote:
> On 2004-08-09, Bjørge Sæther <bjorge@hahaha_itte.no> wrote:
>> The black-box thinking of OO doesn't mean
>> that you don't have the source for your classes, ya know...;-)
>
> .... In theory. However practice is different.
..in the sense that you may not be allowed to change the code. But that's
more about code reuse and problems introduced here.
>> Are you sure you *know* OOP ? I just can't understand what's worse
>> with a method than some other flat plain routine living in some unit
>> ?
>
> A useless extra scope? An instantiation that is unnecessary? A
> grouping that is not natural?
Bad OOP, yes. It can really be a nightmare.
I do not *only* write OO code. But - once I recognize a pattern like
"hmmm...all these routines concern a data structure ilke this...hmmm", then
the conclusion may be: "...I'll turn it into a class !". Typically, when a
group of routines take a data structure as a parameter, it's a good case for
OO. IMHO ;-)
>> You don't have* to use polymorphism or any of that nasty stuff...
>
> What's the point then?
The other things - data and code together. initialization & finalization
routines. "InstanceSize", "ClassName", "RTTI", "Messaging", "Interfaces",
"TStringList", "TList".
> I use OOP. All the time. But I explicitely chose for a multi-paradigm
> language as Delphi to escape it, if it is not needed.
It's not *needed*, of course. But it wouldn't be much of a problem if it was
mandatory. Again IMHO ;-)
>> Now, the final argument about the syntax: "Object.Method" is that
>> when you have just written "Object.M"...and there's a nice list
>> popping up showing all methods and fields of that class starting
>> with "M". Beautiful. Self-documentary !!!
>
> Try
>
> unitname.
>
> or
>
> programname.
Oh, yes. In a one-class-one-unit style of units, yes. My units typically
have a number of classes, and they would normally have routines for more
than one specific parameter type. I see programmers use procedure names like
"Int_XXXX" to solve part of this, the parallell to Java-style "Integer.XXX".
It's just a matter of preferences, but I believe I'm not the only one
finding OOP cleaner at this point.
>>> My argument is that I wanted a way to discover how big a variable on
>>> the other side of the procedure call was... that's all.
>>
>> What could you possibly do with this number without knowing anything
>> more ?
>
> Hmm. How to explain this. Hmm, maybe if I switch to OOP context:
>
> Implement tstream write/read methods without size value ?
Read/write on unspecified types is possible with Read() / Write(). I have
never come to miss being able to read the actual variable size, though, even
if it could save a few lines of code in the stream stuff. But if it was to
be *really* useful, you'd need the data type as well (much like with
variants).
-- Regards, Bjørge Sæther bjorge@haha_itte.no ------------------------------------- I'll not spend any money on American Software products until armed forces are out of Iraq.
- Next message: Bjørge Sæther: "Re: Discovering variable types..."
- Previous message: Bjørge Sæther: "Re: Discovering variable types..."
- In reply to: Marco van de Voort: "Re: Discovering variable types..."
- Next in thread: David Reeve: "Re: Discovering variable types..."
- Reply: David Reeve: "Re: Discovering variable types..."
- Reply: Marco van de Voort: "Re: Discovering variable types..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|