[fpc-pascal] Re: Maybe a new fpc book :)

Milan Marusinec milan at marusinec.sk
Thu Jan 3 00:49:09 CET 2008


Hello,
>                 4. Do people make heavy use of Free Pascal objects?
>                 
>   

I will answer this question in the sence of meaning the object as a type 
for OOP.

Recently in my two pascal projects, which by the way are relatively very 
current,
I used only "objects" and not "classes". You can find those projects here:
  http://www.aggpas.org (Vector Graphics Engine, native port)
  http://www.icu4pas.org (Unicode I18N library, direct class wrapper)

Every delphi programmer would wonder why the hell to use that archaic
type, which is marked as "obsolete" in Borland documentation. But it has
a very strong technical background argument in simple fact, and that is
impossibility to allocate classes on the stack, because classes are always
allocated on the Heap. Here again delphi programmer would very very
wonder, why one would want to allocate classes on the Stack ? Answer is that
those two project are direct 1:1 ports from C/C++, where classes technically
can be on Stack and also on the Heap, and to mimic this behaviour is 
possible
only when using "object" types and not "classes".

That's my two cents
Milano




More information about the fpc-pascal mailing list