On Fri, 16 Jun 2006 09:46:57 +0300
ik <[EMAIL PROTECTED]> wrote:

> On 6/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> > > 1. class that can have more then one object as it's parent (at this
> >
> > Multiple Inheretance. Difficult to understand, difficult to implement,
> > but I have a problem where multiple inheretance was the solution,
> > instead of multiples interfaces.
> 
> Difficult ? While interfaces does not have any execution code, Classes
> do, so any real code such as functions and properties can be shared by
> classes. It's much less work in the long run, and still not that hard
> to understand then the use of interfaces...

Maybe it is a myth: C++ creates slower OO code, because its OO is complex
and supports even multiple inheritance. Does someone know if this is true?


> > > 2. Powerful containers for class usage such as class X requires class
> >
> > Same as templates/generics.
> 
> Actually it's more an RTTI feature that we can use in order to control
> better our code.
> We do have strong RTTI, but we can make it even stronger :)

Can you give an example?


> > > 3.  Better/Faster IO usage ;)
> >
> > Better designed I/O libraries/classes ?
> 
> Better way to control the I/O buffering etc... so we will not need to
> "hack" our way to have bigger container then 255 chars...

Perhaps even better: Automatically adapting the buffer size.
The RTL must work with all kinds of programs. There is no single best buffer
size.


> > > 4. The amount of classes that comes with Java as part of the compiler
> > > :P
> >
> > Can live with them. Make your own libraries.
> 
> You are loosing the reason to work with Pascal. When you have ready to
> use libraries that come with the language, you increase development,
> and it means that you can show what the language can actually do. You
> need a complex graph, plotting etc calculation ? use the "GraphMath"
> unit... You need an XSLT(2) support ? use the xslt unit. You need SNMP
> traps support ? use that unit ...etc..

AFAIK the FPC team adds happily new classes to the standard/extra packages.
Just contribute.


> > > 5.  Associative/anonymous classes (like in script language).
> >
> > Not recomemnded. Dificult to control.
> 
> How come ?
> MyClass.SubClassA := class(something).Create(something);
> MyClass.SubClassA['Private'].FName : string := 'Anonymous class';
> MyClass.SubClassA['published'].Name : string read Self.SubClassA.FName
> write  Self.SubClassA.FName
> ...
> 
> 
> It can be actually much powerful (please ignore the way that the above
> syntax is looking, it's not that destined)...
> 
> >
> > > 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 ...

In OO the implementation should be separate from the interface. Of course
this is a matter of taste and the used Editor.


> > > 7. Build in regex syntax like in Perl, Ruby Javascript.
> >
> > Replace it, by a library.
> 
> Why ?!
>  S := 'We are programming in Perl';
>  S :=~ s/Perl/Pascal/s;
> 
> Doesn't it nicer then to use something like:
> 
> S := 'We are programming in Python';
> Regex := TRegex.Create;
> Regex.compile ('Python',S);
> S := Regex.Replace ('Pascal', 's');
> 
> Sure it's cool to use external functions, but it's useful to use it as
> a syntax structure :)

See ideintf/texttools.pas. Then the above would be

  S := 'We are programming in Perl';
  S := REReplace(S,'Perl','Pascal','s');

IMHO this is better to read and better to understand for newbies, than the
short but cryptic perl syntax.


> > > 8. Templates. (there is something that is cooking)
> >
> > OK. This one is right. We reealy need templates/generics support.
> 
> That's actually a debug hell, and usually there are workaround :P
> But, it can be useful and give us a lot more flexibility.

They already work for basic cases in fpc 2.1.1.


>[...]


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to