2006/6/16, Michael Van Canneyt <[EMAIL PROTECTED]>:
>> >>>> 6. "inline" code inside class (like in C++/Java).
>> >>>
>> >>> Not recommended. Bad design.
>> >>
>> >> Huh ?!
>> >>
>> >> destructor Destroy; override;
>> >> begin
>> >> inherited Destroy;
>> >> end;
>> >>
>> >> Why should i place it somewhere else ?! To remind you, I could use
>> >> "inline" command in order to place code of functions in the interface
>> >> sections on TP... So the Pascal language do have history of such
>> >> things ...
>>
>> The above code is superfluous. you don't need this code at all.
>
> Why ? If I have less of 10 lines of code to write, it's easier to
> write it in place IMHO ...
That's simply "personal laziness", so to speak.
And I'm a lazy pascal coder in fact... When your class is well
defined, using code completion (Shift+Ctrl+C) will do all the class'
code implementation for you, declare variables and functions of
properties, etc. So you can think of the design first, then just fill
in the blank once code completion has been called. So there is nothing
hard in that.
We're talking about language design:
The point is strict separation of interface and implementation.
This is a language design principle.
I think this is the whole point and also my opinion: this is language
design - and I like it like that: Interface, then implementation. It
makes the whole thing clear.
(In fact this is one of the first thing I found great in Pascal
compared to C when I saw the language the first time - and I was one
of those "Hey! I'm coding in C you know!" - I had a lot of time to
waste in those years...)
Regards.
--
Alexandre Leclerc
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives