[fpc-devel] Re: [fpc-l] type discussion

Ales Katona ales at chello.sk
Thu Jun 2 15:16:30 CEST 2005


Jamie McCracken wrote:

> Marc Weustink wrote:
>
>>
>>
>> What is easier to read is a matter of taste.
>> Being a pascal devel for years now, it takes time to "decode" a  "a := b
>> := c := d := 0"  line. There might be a ; inbeween which results in a
>> complete different assignment. With such lines I've to read them over 
>> and
>> over to see what is going on.
>> Where a line like "a := 0; b := 0; c := 0; d := 0;" is clear to me.
>> This also counts for the proposed c-isms.
>>
>> For me I prefere clarity above less typing (besides if you want to write
>> realy short code, you sould use APL)
>>
>
> I totally agree with you in this case - we dont want or need cryptic c 
> stlye syntax in any version of Pascal.
>
> However, in general Pascal has poor developer productivity when 
> compared to modern languages like python and C#. Ironically python is 
> perhaps the most popular language on Linux and most of its syntax is 
> derived from object pascal whereas pascal on linux is virtually 
> non-existant. Of course Python is piss poor in both performance and 
> memory usage but it does point the way to a revitalised pascal. 
> Adopting less verbose but still clean and clear syntax ala python is 
> IMHO the way to make Pascal great again.
>
> Consider the developer unfirendly nature of pascal/Delphi atm:
>
> 1) Forward declarations - they sux! Why should the developers have the 
> burden of making the code totally sequential declaration wise. All 
> other modern compilers dont need this. Sure your code might take a bit 
> longer to compile but thats peanuts compare to the time saved in extra 
> typing and reordering your code
>
> 2) I have touched on manual memory managaement of tobjects before so I 
> wont rehash it here (in summary ref count tobjects and they should 
> have good performance with c++ style exception handling).
>
> 3) loads of small and pointless additional syntax like EG for creating 
> an object you should just be able to say:
>
> myobject.create;
>
> and not
>
> myobject := Tobject.create;
>
> also Begin..End blocks should IMO be replaced with python's indenting.
>
> Yeah I know this sounds like a hybrid pascal/python but I believe 
> thats the way to go - marry Delphi's speed and component framework 
> with less verbose python style syntax and you will have the best RAD 
> language ever written.
>
> jamie.
>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>
MyObject.Create is impossible with classes on the heap. You need to 
assign MyObject a pointer but you can't do that from within create.

Forward declarations are IMHO required because otherwise the compiler 
would have to make additional passes(it does 3 AFAIK).
Besides, they are seldom enough to be a problem.

How does python handle modularity btw?




More information about the fpc-devel mailing list