dodicat wrote: ↑Apr 13, 2023 16:22
marcov
for n:=0 to 10 do writeln(n);
Surely you wouldn't advise
for n:=0 to 10 do
begin
writeln(n);
end;
The begin is to signal a multiline block. If it is _always_ a multiline block it can be omitted for non procedural blocks (and indeed Pascal's successor Modula-2 did just that). Compilable Basics like QB and VB might have adapted that from the get go.
One can discuss if the END must be decorated with a block type ("end if" or even M2's "end 'subname';"), but in general I'm not in favour of that. Preferably the syntax should be good enough to localize the error without this. (C sets a bad examples here, as mistakes in the blockstructure can swallow the start of a new procedure)
I don't use an ide which adds an end of block automatically, whether end; or end if or }, code completion? or whatever it is called.
No problem. The mandatory End is still only a 3 letter word without difficult and hard to type shifted letters. But you can always insert extra lines into the block (no adding begin.. end with a lot of extra cursor movements that require moving your hand)
The mandatory end-block marker also makes it easier to find mistakes.
Of course for Pascal this is all hypothetical, the base block structure has been fixated since the seventies (and dates to the sixties)