Thread View: net.lang.pascal
1 messages
1 total messages
Started by utzoodecvaxharponpoivhou5farielv...
Sat, 19 Feb 1983 14:53
then else etc.
Author: utzoodecvaxharponpoivhou5farielv...
Date: Sat, 19 Feb 1983 14:53
Date: Sat, 19 Feb 1983 14:53
30 lines
1449 bytes
1449 bytes
I've often suggested to students that they write if statements this way:
if conditon then begin if condition then begin
statements -or- statements
end else begin end
statements
end
This is a reasonable way to create a "bracketed" if statement, avoids
deep nesting caused by compound statements, and minimizes the number of
lines used on the terminal, which means you can see a useful amount of
code using a screen editor on a 24 line terminal.
Of course, this isn't the only possible way; if the statement is short,
there's no reason not to write
if condition then statement;
But as a general approach, the bracketing scheme seems to work well.
Please, no religous debates about the ultimate indenting scheme for Pascal.
I don't want to start a long exchange of worthless notes of the flavor
"my indenting scheme is better than yours". Of course, if you have some
useful, and hopefully novel, suggestions, feel free to post them.
Hal Perkins
uucp: {decvax|vax135|...}!cornell!hal
arpa: Hal@Cornell
bitnet: Hal@crnlcs
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads