Nice try but, there is wrongly formatted code.
Oh, lets not get too excited here.
I'm not getting excited but, it does bother me when indentation does not reflect the structure of the language.
Formatting in Pascal is about style,
I honestly don't believe that. In Pascal, "begin" is terminated with an "end", because of that, they should be at the same level. This isn't a choice I make, it's inherent in the structure of the language. I know that "deforming" the language structure is commonly done and swept under the rug of "style" but, I don't consider that to be valid or justified.
PascalDragon's (and my) preferred style is just that, our preference.
I understand that but, it certainly isn't the preference of the compiler. If someone chose to write a piece of code like this:
if <condition> then
<statement>
<statement>
end;
As much as some people "prefer" that, a standard Pascal compiler would not accept it.
It compiles fine
Yes, it does but, it visually breaks the structure of the language. That's the part that is objectionable.
and is, to us at least, more readable.
I cannot figure out how some people find that "style" more readable. You have to scan more text from left to right to mentally build the blocks because "begin" is not aligned with "end". Because the formatting doesn't reflect the structure of the language, the reader has to mentally scan and restructure the text for it to match the structural semantics of the language. It's a lot more work for the person who reads the code.
If you are uncomfortable reading it, its just because its not a style you use. If you found yourself working in a team where that style was required, I am quite sure you would adapt to it quite quickly, perhaps not prefer it but you would have no trouble reading in.
I honestly wouldn't work as part of a team that required that "style". I'd wish them good luck and work someplace else.
There are heaps of other 'personalisations' we all use, capitals, CamelCase etc.
There should be a reason for a "personalization" to exist. For instance, it is quite common to uppercase constants. The reason is make it obvious anywhere in the program they are a constant. I consider such "personalizations" to be justified and useful.
Breaking the alignment level of a begin/end pair is a "personalization" that is "justified" with the poor argument that it saves one line and in many cases it doesn't even do that. Consider this
if <somecondition> then
begin // not a singularity point, calculate the derivative at the point
<statement>
<statement>
end
else // a singularity point, inform the reader how it will be handled.
begin
<statement>
<statement>
end;
Since the "begin" is on a separate line, a comment can be appended to it informing the programmer what the group of statements is for. When the "begin" is not on a separate line, either there is no good place for the comment or the comment has to be on a separate line nullifying the "one line gain" used to justify not putting on a line by itself.
The real problem is that a lot of indentation "styles" have no justification other than "I like this way". That's not much of a solid foundation to justify it.