On Tue, 13 Nov 2007 22:59:50 +0200 ik <[EMAIL PROTECTED]> wrote: >[...] > > What I found in Lazarus code so far was that somebody _was_ peaking > > at the Delphi code at some stage.
Yes. 1. Many pascal programmers have several years Delphi experience and are used to the Delphi coding style and naming scheme. So when they create a new method/class, the variables will usually have Delphi names, Delphi block sizes, etc. 2. There was a short discussion some years ago when I started the codetools, how the generated code should look like. I feared that when the codetools class completion creates the same code as Delphi, people will eventually come up with copyright. The only strange thing is that it took 6 years. One fourth of the LCL is auto generated code. >[...] > And it also looks like lack of good imagination, and the wish to make > the code more readable :) Many keep Delphi compatibility, because they like it, not only OOP and the Delphi features, but the coding style as well. > > Good news is that that's where the similarity ends (well in the > > units I checked). Importantly, the method bodies seem to be > > implemented differently, except for the very elementary methods. > > What are the elementary methods ? Attached is an example. Mattias
lazarus/lcl/include/control.inc: line 1044-1056|Vcl/Controls.pas: line 3597-3606[55] Function TControl.ScreenToClient(const |function TControl.ScreenToClient(const var |var P : TPoint; |Origin: TPoint; begin |begin P := ClientOrigin; |Origin := ClientOrigin; Result.X := APoint.X - P.X; |Result.X := Point.X - Origin.X; Result.Y := APoint.Y - P.Y; |Result.Y := Point.Y - Origin.Y; end; |end;
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel