Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!iuvax!pur-ee!pur-phy!hal From: hal@pur-phy (Hal Chambers) Newsgroups: comp.lang.modula2 Subject: Re: Good Modula Style Message-ID: <932@pur-phy> Date: Tue, 17-Nov-87 07:22:14 EST Article-I.D.: pur-phy.932 Posted: Tue Nov 17 07:22:14 1987 Date-Received: Fri, 20-Nov-87 06:02:59 EST References: Reply-To: hal@newton.physics.purdue.edu.UUCP (Hal Chambers) Organization: Purdue Univ. Physics Dept., W. Lafayette, IN Lines: 29 In article Info-Modula2 Distribution List writes: > IF TRUE THEN > J := I + 1 > ELSIF NOT TRUE THEN > J := I - 1; ..... I would also recommend using semicolon as a statement terminator rather than a separator. Modula-2 specifically allows the extra semicolon so that this may be done. IF TRUE THEN J := I + 1; ELSIF NOT TRUE THEN J := I - 1; ..... Although it isn't syntactically required, it results in a more uniform appearance to the code. Also, if a substantial block of code follows the IF and you latter add more statments to the block, it is easy to miss the omitted semicolon when the J:=I+1 is no longer the last statment of the block. Admittedly this is a matter of style (read: personal preference) and I do not claim that the form omitting the semicolon is in any sense "ugly" or anything like that. Hal Chambers