Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: "BartC" Newsgroups: comp.compilers Subject: Re: Programming language and IDE design Date: Sat, 19 Oct 2013 22:05:23 +0100 Organization: virginmedia.com Lines: 62 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <13-10-017@comp.compilers> References: <13-10-016@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: leila.iecc.com 1382242454 55621 64.57.183.58 (20 Oct 2013 04:14:14 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sun, 20 Oct 2013 04:14:14 +0000 (UTC) Keywords: design, comment Posted-Date: 20 Oct 2013 00:14:14 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1000 "Martin Ward" wrote in message > (3) Indentation helps the reader if it is consistent: so should also > be enforced by the compiler. In line with point (2), nesting should > be defined by *both* indentation *and* grouping keywords: > with the compiler enforcing consistency between the representations. > This means that the reader can rely on either indication of nesting, > since both are reliable. > [On the other hand, having recently written a lot of python code, I've > come around to the opinion that enforced indentation is all the grouping > you need. -John] Grouping provides useful extra redundancy and inspires more confidence in the reader of the code. Example: s1 # statement 1 if cond: s2 s3 s4 s5 s6 An accidental press of Delete before s4 removes the tab (although I've used spaces for usenet purposes. And if usenet has also eaten those spaces, then s2, s3 and s4 should be indented). Now the code still compiles, but doesn't do the same thing: s1 if cond: s2 s3 s4 s5 s6 Compare with a version using begin-end grouping: s1 if cond then s2 s3 s4 end if s5 s6 It still works correctly whether there's a tab in front of s4 or not. The presence of the 'end if' reinforces that belief that s4 is part of the conditional block. Transmission often removes tabs, or mixes up tabs and spaces, or removes what it thinks is superfluous white space altogether. -- Bartc [Chacun a son gout -John]