[fpc-pascal] Syntax changes suggestions

Michael Van Canneyt michael at freepascal.org
Tue Jul 17 11:14:31 CEST 2018



On Tue, 17 Jul 2018, Henry Vermaak wrote:

> On Mon, Jul 16, 2018 at 03:02:42PM +0200, Sven Barth via fpc-pascal wrote:
>> Santiago A. <svaa at ciberpiula.net> schrieb am Mo., 16. Juli 2018, 13:41:
>> 
>> > I have some suggestions of change to freepascal syntax, just to debate
>> >
>> > (All are backward compatible)
>> >
>> > - Declaring variables inside blocks, and loop variables
>> >
>> -> reduces readability -> no interest
>
> How can it reduce readability?  You move variables closer to where they
> are used, therefore reducing clutter in the main "var" section.

Pascal separates declaration from implementation. 
This proposal changes that, it mixes implementation with declaration.

When you look for a variable, you know it is in the declaration block.
If you need to start scanning the code, this is a major nuisance.
I can't count the misunderstandings in Javascript due to this 'feature'.

Given that the length a typical routine should not exceed 50 lines 
- i.e. fits on a modern screen - you can :
a) not have too many variables anyway.
b) see them at the glance of an eye at the top of your screen.

Michael.



More information about the fpc-pascal mailing list