Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-17 Thread Felipe Monteiro de Carvalho
On Sun, Jan 15, 2012 at 12:59 AM, Lars nore...@z505.com wrote:
 Personally, I'm getting sick of all the new features added to delphi that
 don't add anything meaningful, and just add complexity to the compiler.

Why is compiler complexity relevant (if true at all that the new
features add significant complexity)? Are you sending patches to the
compiler and finds that the new features disturb this?

About adding something meaningful, this varies from one person to
another one. For me new features might not be useful now, but if there
is a chance they might be useful in the future, then they are good
features to have. Use cases are often not obvious. I would normally
not think that static class methods are useful, but they were very
useful for me in the early days of PasCocoa. And if a features will
never be useful to me, then they will be for someone else (if they
were useful for noone, then noone would have written the code to
support them in the first place)

And if you dont like them, you dont need to use them. The LCL rarely
uses newer compiler features. I would say the same for most code in
the FCL.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread J.-c. Chu
Frankly, every new feature will be a mere increase of complexity if you
reject learning about it.

There is a listing, despite not up-to-date, of new language features
since Delphi 7, at http://edn.embarcadero.com/article/34324.  Not all
of them are currently implemented in FPC.  Could you point out which of
them is “nonsense” or “only saves some keystrokes”?


On January 15, 2012, Jürgen Hestermann wrote:
 
 
 Lars schrieb:
 Personally, I'm getting sick of all the new features added to delphi that
 don't add anything meaningful, and just add complexity to the compiler.
 why didn't borland just make people use old borland objects with methods
 instead of new advanced records? Old borland objects are advanced
 records..

 Ticking me off more: why do we even have objects and classes? what is an
 object? what are classes?  I would have preferred if borland would have
 just called old borland objects Extended records from day one. Now we
 have this feature overload in the language and it's becoming more and
 more
 complex of a language (needlessly). Objects, Classes, records.. aren't
 they all the same thing? I don't even personally buy the idea that
 objects
 even exist.. i think they are just extended records. What is an
 object? an
 instance of a class? if so, why did borland call the type definition
 object if it was supposed to be a class? Ugh. Ugly language - it is
 becoming - sorry to say!

   
 I agree wholeheartly with you!!
 
 Lots of nonsense is added that is already available otherwise (or only
 saves some keystrokes).
 In the past Pascal was an easy to learn (still powerfull) language.
 Today the direction goes
 into increased complexity as all the other languages and nobody realy
 understands it anymore
 so programmers code in a suboptimal manner more and more.
 
 Some may say: You don't have to use it. That's true. But I am also no
 longer able to read
 foreign code (i.e. Lazarus program code) because all these strange
 concepts are used there.
 
 
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-- 
Best Regards,
J.-c. Chu
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Sven Barth
Am 15.01.2012 00:59 schrieb Lars nore...@z505.com:

 Daniel Gaspary wrote:
  Any special reason to Advanced Records be available only in Delphi Mode
?


 Personally, I'm getting sick of all the new features added to delphi that
 don't add anything meaningful, and just add complexity to the compiler.
 why didn't borland just make people use old borland objects with methods
 instead of new advanced records? Old borland objects are advanced
 records..

Although I don't know why Borland did it that way (and I'm also not that a
big fan of that extension (but I use them)), I can assure you that advanced
records and objects are not the same:
* objects support inheritance and destructors
* advanced records support the declaration of operators inside them
(important for genetics) and variant parts

 Ticking me off more: why do we even have objects and classes? what is an
 object? what are classes?  I would have preferred if borland would have
 just called old borland objects Extended records from day one. Now we
 have this feature overload in the language and it's becoming more and more
 complex of a language (needlessly). Objects, Classes, records.. aren't
 they all the same thing? I don't even personally buy the idea that objects
 even exist.. i think they are just extended records. What is an object? an
 instance of a class? if so, why did borland call the type definition
 object if it was supposed to be a class? Ugh. Ugly language - it is
 becoming - sorry to say!


Objects were introduced in Turbo Pascal. There were no classes yet, only
objects. When they introduced classes they realized that the object concept
wasn't powerful enough, but because of backwards compatibility they decided
not to fix the objects (or adding a compilerswitch for changing the
functionality) but to introduce a new language construct.
The advanced records were AFAIK introduced, because they added them for
Delphi.Net and they wanted to unify the two platforms a bit.

And yes, the word object now has two meanings in case of Pascal:
* the old OOP concept
* an instance of a type of the new concept

I also can assure you that at least in the FPC compiler (advanced) records
and objects are not the same.

A little sidenote at the end: in mode MacPascal types declared as object
are handled like class, because the objects in MacPascal are closer to
Delphi's classes than to TP's objects.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Daniel Gaspary
On Sun, Jan 15, 2012 at 04:43, J.-c. Chu jc...@acm.org wrote:
 For one thing, class variables, class methods, and class properties are
 subject to visibility controls and inheritance.

 So you can, for example, have a private class variable initialized with
 class constructor (which avoids code in the INITIALIZATION section) and
 accessed via a read-only class property (which is impossible with
 unit-level variables).

Interesting, thank you for share this use case.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Daniel Gaspary
On Sun, Jan 15, 2012 at 11:44, J.-c. Chu jc...@acm.org wrote:
 There is a listing, despite not up-to-date, of new language features
 since Delphi 7, at http://edn.embarcadero.com/article/34324.  Not all
 of them are currently implemented in FPC.

I believe could be really useful to have a grid style in just one page
with compability status.

Is there something similar to this page at fpc wiki ?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Marco van de Voort
In our previous episode, J.-c. Chu said:
 Frankly, every new feature will be a mere increase of complexity if you
 reject learning about it.
 
 There is a listing, despite not up-to-date, of new language features
 since Delphi 7, at http://edn.embarcadero.com/article/34324.  Not all
 of them are currently implemented in FPC. 

Which ones aren't? 

 Could you point out which of
 them is ?nonsense? or ?only saves some keystrokes??

Below is a link to a very old discussion of the above article:

http://www.stack.nl/~marcov/delphilater.txt
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread J.-c. Chu
class abstract?

On January 15, 2012, Marco van de Voort wrote:
 Which ones aren't? 

-- 
Best Regards,
J.-c. Chu
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Jürgen Hestermann

J.-c. Chu schrieb:
 Frankly, every new feature will be a mere increase of complexity if you
 reject learning about it.

So how should in your opinion (Object) Pascal look like in say 10 or 15 
years?
If new features are added with the same speed as in the past, it would 
become
a monster that only those who grew up with it (without gap) or who 
invest months
of learning can control.. Every novice would surrender because the 
learning curve

is so steep. It's no surprise that other scipting languages are so popular.
In general they are much easier to learn.

Borland/Embacadero was the driving force behind all these changes and 
FPC had
to follow if it wanted to stay compatible. But Borland added all these 
features
just for one reason: They had to sell new versions of Delphi. Not the 
new users
were the target but the existing (who should upgrade). The new ones are 
(were)
coming anyway because they were forced to (by the existing users). But 
if one
day FPC frees from Delphi then I hope that this annoying feature-creep 
stops.




 There is a listing, despite not up-to-date, of new language features
 since Delphi 7, at http://edn.embarcadero.com/article/34324.  Not all
 of them are currently implemented in FPC.  Could you point out which of
 them is “nonsense” or “only saves some keystrokes”?

I may not be a standard user (but in the end, who is?) but I have never 
used
(nor missed) any of the mentioned concepts, nor collections, nor objects 
nor

classes nor whatever has been added in the last 20 years and I have never
missed any of them. My programs are lightning fast and easy to understand.

The only thing that changed was that the number (and mightiness) of used
libraries. But I can use them all with Pascal concepts that exist since 
Turbo Pascal.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Sven Barth

On 15.01.2012 16:55, J.-c. Chu wrote:

class abstract?

On January 15, 2012, Marco van de Voort wrote:

Which ones aren't?




Implemented since 2.4.2 or 2.4.4 AFAIK.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Sven Barth

On 15.01.2012 16:47, Marco van de Voort wrote:

In our previous episode, J.-c. Chu said:

Frankly, every new feature will be a mere increase of complexity if you
reject learning about it.

There is a listing, despite not up-to-date, of new language features
since Delphi 7, athttp://edn.embarcadero.com/article/34324.  Not all
of them are currently implemented in FPC.


Which ones aren't?


They should all be part of FPC now (only if they meant TMyClass = 
record in their operator overloading example though - the example given 
as is is AFAIK not compileable neither by FPC nor by Delphi).


Segards,
Sven

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Jetcheng Chu
I’m not brave enough to predict what Pascal is going to look like in a
decade.  It’s true that features should not be added promiscuously, but
I don’t think Delphi is a fair target of blame.

Let’s again have a look at the table in
http://edn.embarcadero.com/article/34324.  Basically we can group
those features as follows.

1.  Catching up with other langauges: operator overloading.

Operator overloading makes certain code more readable.

2.  Finer scoping and encapsulation: class-local types, variables,
constants, and properties; “advanced” record syntax; STRICT
visibilities; STATIC CLASS methods; class helpers; CLASS ABSTRACT;
CLASS SEALED; and FINAL methods.

These really are refinements of long-existed concepts, which cannot
be elegantly reduced to pre-existing constructs.

3.  Misc: routine inlining; FOR–IN loops.

The FOR–IN loop is the only thing that I personally find
objectionable; that’s one in 17 (according to the table in the
article).

There is no substantially new concepts.  None of them are difficult to
understand, certainly not requiring “months of learning”.  And if you
need some help, a simple Google query with “site:embarcadero.com” will
almost do the job.

I understand that for someone who’s been avoiding OOP in the past 20
years these new features may be annoying.  But in the meantime there are
people who grew up with object-oriented languages, and they might
welcome these changes.


On January 16, 2012, Jürgen Hestermann wrote:
 J.-c. Chu schrieb:
 Frankly, every new feature will be a mere increase of complexity if you
 reject learning about it.
 
 So how should in your opinion (Object) Pascal look like in say 10 or 15
 years?
 If new features are added with the same speed as in the past, it would
 become
 a monster that only those who grew up with it (without gap) or who
 invest months
 of learning can control.. Every novice would surrender because the
 learning curve
 is so steep. It's no surprise that other scipting languages are so popular.
 In general they are much easier to learn.
 
 Borland/Embacadero was the driving force behind all these changes and
 FPC had
 to follow if it wanted to stay compatible. But Borland added all these
 features
 just for one reason: They had to sell new versions of Delphi. Not the
 new users
 were the target but the existing (who should upgrade). The new ones are
 (were)
 coming anyway because they were forced to (by the existing users). But
 if one
 day FPC frees from Delphi then I hope that this annoying feature-creep
 stops.
 
 
 
 There is a listing, despite not up-to-date, of new language features
 since Delphi 7, at http://edn.embarcadero.com/article/34324.  Not all
 of them are currently implemented in FPC.  Could you point out which of
 them is “nonsense” or “only saves some keystrokes”?
 
 I may not be a standard user (but in the end, who is?) but I have never
 used
 (nor missed) any of the mentioned concepts, nor collections, nor objects
 nor
 classes nor whatever has been added in the last 20 years and I have never
 missed any of them. My programs are lightning fast and easy to understand.
 
 The only thing that changed was that the number (and mightiness) of used
 libraries. But I can use them all with Pascal concepts that exist since
 Turbo Pascal.
 
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-- 
Jetcheng Chu
http://people.rerouted.org/jcchu
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread J.-c. Chu
The attached file does not compile in my trunk-version compiler.

On January 16, 2012, Sven Barth wrote:
 On 15.01.2012 16:55, J.-c. Chu wrote:
 class abstract?

 On January 15, 2012, Marco van de Voort wrote:
 Which ones aren't?

 
 Implemented since 2.4.2 or 2.4.4 AFAIK.
 
 Regards,
 Sven
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-- 
Best Regards,
J.-c. Chu
{$MODE delphi}

type
  TTestClass = class abstract
procedure TestMethod;
  end;

begin
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-15 Thread Marco van de Voort
In our previous episode, J.-c. Chu said:
 The attached file does not compile in my trunk-version compiler.

As Sven already said, that example doesn't compile in Delphi either.

Embarcadero Delphi for Win32 compiler version 22.0
Copyright (c) 1983,2010 Embarcadero Technologies, Inc.
xxx.dpr(8)
xxx.dpr(3) Error: E2065 Unsatisfied forward or external declaration:
'TTestClass.TestMethod'
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-14 Thread Lars
Daniel Gaspary wrote:
 Any special reason to Advanced Records be available only in Delphi Mode ?


Personally, I'm getting sick of all the new features added to delphi that
don't add anything meaningful, and just add complexity to the compiler.
why didn't borland just make people use old borland objects with methods
instead of new advanced records? Old borland objects are advanced
records..

Ticking me off more: why do we even have objects and classes? what is an
object? what are classes?  I would have preferred if borland would have
just called old borland objects Extended records from day one. Now we
have this feature overload in the language and it's becoming more and more
complex of a language (needlessly). Objects, Classes, records.. aren't
they all the same thing? I don't even personally buy the idea that objects
even exist.. i think they are just extended records. What is an object? an
instance of a class? if so, why did borland call the type definition
object if it was supposed to be a class? Ugh. Ugly language - it is
becoming - sorry to say!
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-14 Thread Marcos Douglas
On Sat, Jan 14, 2012 at 9:59 PM, Lars nore...@z505.com wrote:

 Daniel Gaspary wrote:
  Any special reason to Advanced Records be available only in Delphi Mode ?


 Personally, I'm getting sick of all the new features added to delphi that
 don't add anything meaningful, and just add complexity to the compiler.
 why didn't borland just make people use old borland objects with methods
 instead of new advanced records? Old borland objects are advanced
 records..

+1

 Ticking me off more: why do we even have objects and classes? what is an
 object? what are classes?  I would have preferred if borland would have
 just called old borland objects Extended records from day one. Now we
 have this feature overload in the language and it's becoming more and more
 complex of a language (needlessly).

+1 again.
I agree that becoming the language more and more complex needlessly.

 Objects, Classes, records.. aren't
 they all the same thing?

As I think you know, record type defines a data group; (old) object
is a record with functions; classe type is the improvement of both.

 I don't even personally buy the idea that objects
 even exist.. i think they are just extended records.

Oh, they exist... but you also right, they are extended records, we can say.

 What is an object? an
 instance of a class? if so, why did borland call the type definition
 object if it was supposed to be a class? Ugh. Ugly language - it is
 becoming - sorry to say!

I think Borland erred in definition of object type. So they improved
to class type!  =)

Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-14 Thread Daniel Gaspary
On Sat, Jan 14, 2012 at 21:59, Lars nore...@z505.com wrote:
 Personally, I'm getting sick of all the new features added to delphi that
 don't add anything meaningful, and just add complexity to the compiler.

I agrre with you. I like some features of advanced records.

But a lot of things seems a big redundancy.

The possibility of class vars specially surprised me ? For What
purpose that could be good for ?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-14 Thread J.-c. Chu
For one thing, class variables, class methods, and class properties are
subject to visibility controls and inheritance.

So you can, for example, have a private class variable initialized with
class constructor (which avoids code in the INITIALIZATION section) and
accessed via a read-only class property (which is impossible with
unit-level variables).

These “advanced” features are there to provide better encapsulation.
And if you don’t need object-oriented programming, I don’t think they’re
going to harm you or your programs, either.


On January 15, 2012, Daniel Gaspary wrote:
 On Sat, Jan 14, 2012 at 21:59, Lars nore...@z505.com wrote:
 Personally, I'm getting sick of all the new features added to delphi that
 don't add anything meaningful, and just add complexity to the compiler.
 
 I agrre with you. I like some features of advanced records.
 
 But a lot of things seems a big redundancy.
 
 The possibility of class vars specially surprised me ? For What
 purpose that could be good for ?
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-- 
Best Regards,
J.-c. Chu



smime.p7s
Description: S/MIME Cryptographic Signature
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Advanced Records - Why not available by default?

2012-01-13 Thread Daniel Gaspary
Any special reason to Advanced Records be available only in Delphi Mode ?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Advanced Records - Why not available by default?

2012-01-13 Thread Jonas Maebe

On 13 Jan 2012, at 23:41, Daniel Gaspary wrote:

 Any special reason to Advanced Records be available only in Delphi Mode ?

You can always enable them in other modes via {$modeswitch andvancedrecords}


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal