<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Jörg wrote:<div class=""><br class=""><div><blockquote type="cite" class=""><div class=""><span style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Indentation is indeed a totally personal thing.</span><br style="font-family: Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><br class=""></div><div>It is interesting to catalogue the different indentation styles used by some well known (and less well known) programmers of Oberon and Component Pascal source code. With one of the exercises of the Reiser & Wirth book as material I wrote out various indentation styles. <div class=""><br class=""></div><div class="">Crudely four styles of indentation can be discerned:</div><div class="">- No indentation (Daniel)</div><div class="">- Minimal indentation (Reiser / Mössenböck); the difference between the two is in the indentation of declarations (e.g. VAR) at the procedure level</div><div class="">- Classical indentation (Wirth & Gutknecht); has the most consistent indentation of scope levels.</div><div class="">- Knuth indentation (Knuth / Campbell); also quite consistent, but rather convoluted.<br class=""><div><br class=""></div><div><br class=""></div><div><div>MODULE M; (* After Exercise 6.4 (p. 85) from Reiser & Wirth, Programming in Oberon *)</div><div>IMPORT Out;</div><div>VAR i, j: INTEGER;</div><div>PROCEDURE A*;</div><div>VAR i: INTEGER;</div><div>PROCEDURE B(VAR i, j: INTEGER);</div><div>VAR k: INTEGER;</div><div>BEGIN k := i; i := j; j := k END B;</div><div>BEGIN i := 2; B(i, j)</div><div>END A;</div><div>PROCEDURE C*;</div><div>BEGIN A; i := 2*j; </div><div>Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div><div>END C;</div><div>BEGIN</div><div>END M.C</div><div><br class=""></div><div>(**************************************)</div><div><br class=""></div><div>MODULE M; (* Daniel, <a href="http://www.waltzballs.org/other/prog.html#track" class="">http://www.waltzballs.org/other/prog.html#track</a> *)</div><div>IMPORT Out;</div><div>VAR i,j:INTEGER;</div><div><br class=""></div><div>PROCEDURE A*;</div><div>VAR i:INTEGER;</div><div><br class=""></div><div>PROCEDURE B(VAR i,j:INTEGER);</div><div>VAR k:INTEGER;</div><div>BEGIN k:=i;i:=j;j:=kEND B;</div><div><br class=""></div><div>BEGIN i:=2;B(i,j)</div><div>END A;</div><div><br class=""></div><div>PROCEDURE C*;</div><div>BEGIN A;i:=2*j; </div><div>Out.Int(i,5);Out.Int(j,5);Out.Ln</div><div>END C;</div><div><br class=""></div><div>BEGIN</div><div>END M.C</div><div><br class=""></div><div>(**************************************)</div><div><br class=""></div><div>MODULE M; (* M. Reiser, The Oberon System </div><div> and M. Reiser & N. Wirth, Programming in Oberon *)</div><div>IMPORT Out;</div><div>VAR i, j: INTEGER; </div><div><br class=""></div><div>PROCEDURE A*;</div><div>VAR i: INTEGER;</div><div><br class=""></div><div> PROCEDURE B(VAR i, j: INTEGER);</div><div> VAR k: INTEGER;</div><div> BEGIN </div><div> k := i; i := j; j := k </div><div> END B;</div><div><br class=""></div><div>BEGIN </div><div> i := 2; B(i, j)</div><div>END A;</div><div><br class=""></div><div>PROCEDURE C*;</div><div>BEGIN </div><div> A; i := 2*j; </div><div> Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div><div>END C;</div><div><br class=""></div><div>BEGIN</div><div>END M.C</div><div><br class=""></div><div>(*************************************)</div><div><br class=""></div><div>MODULE M; (* H. Mössenböck, Object Oriented Programming in Oberon-2 *)</div><div>IMPORT Out;</div><div>VAR i, j: INTEGER;</div><div><br class=""></div><div>PROCEDURE A*;</div><div> VAR i: INTEGER;</div><div><br class=""></div><div> PROCEDURE B(VAR i, j: INTEGER);</div><div> VAR k: INTEGER;</div><div> BEGIN </div><div> k := i; i := j; j := k </div><div> END B;</div><div><br class=""></div><div>BEGIN </div><div> i := 2; B(i, j)</div><div>END A;</div><div><br class=""></div><div>PROCEDURE C*;</div><div>BEGIN </div><div> A; i := 2*j; </div><div> Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div><div>END C;</div><div><br class=""></div><div>BEGIN</div><div>END M.C</div><div><br class=""></div><div>(**************************************)</div><div><br class=""></div><div>MODULE M; (* Wirth & Gutknecht, Project Oberon *)</div><div> IMPORT Out;</div><div> VAR i, j: INTEGER;</div><div><br class=""></div><div> PROCEDURE A*;</div><div> VAR i: INTEGER;</div><div><br class=""></div><div> PROCEDURE B(VAR i, j: INTEGER);</div><div> VAR k: INTEGER;</div><div> BEGIN </div><div> k := i; i := j; j := k </div><div> END B;</div><div><br class=""></div><div> BEGIN </div><div> i := 2; B(i, j)</div><div> END A;</div><div><br class=""></div><div> PROCEDURE C*;</div><div> BEGIN </div><div> A; i := 2*j; </div><div> Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div><div> END C;</div><div><br class=""></div><div>BEGIN</div><div>END M.C</div><div><br class=""></div><div>(**************************************)</div><div><br class=""></div><div>MODULE M; (* Knuth. E.g. see: <a href="http://brokestream.com/tex.pdf" class="">http://brokestream.com/tex.pdf</a> *)</div><div> IMPORT Out;</div><div> VAR i, j: INTEGER;</div><div><br class=""></div><div> PROCEDURE A*;</div><div> VAR i: INTEGER;</div><div><br class=""></div><div> PROCEDURE B(VAR i, j: INTEGER);</div><div> VAR k: INTEGER;</div><div> BEGIN k := i; i := j; j := k </div><div> END B;</div><div><br class=""></div><div> BEGIN i := 2; B(i, j)</div><div> END A;</div><div><br class=""></div><div> PROCEDURE C*;</div><div> BEGIN A; i := 2*j; </div><div> Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div><div> END C;</div><div><br class=""></div><div> BEGIN</div><div> END M.C</div><div><br class=""></div><div>(**************************************)</div><div><br class=""></div><div><div>MODULE M; (* R. Campbell, Subsystem Lib for BlackBox Component Framework, </div><div> see the Component Pascal Collection, <a href="http://www.zinnamturm.eu/" class="">http://www.zinnamturm.eu/</a> *)</div><div>IMPORT Out;</div><div>VAR </div><div> i, j : INTEGER;</div><div><br class=""></div><div>PROCEDURE A*;</div><div> VAR </div><div> i : INTEGER;</div><div><br class=""></div><div> PROCEDURE B(VAR i, j : INTEGER);</div><div> VAR </div><div> k : INTEGER;</div><div> BEGIN </div><div> k := i; i := j; j := k </div><div> END B;</div><div><br class=""></div><div> BEGIN </div><div> i := 2; </div><div> B(i, j)</div><div> END A;</div><div><br class=""></div><div>PROCEDURE C*;</div><div> BEGIN </div><div> A; </div><div> i := 2*j; </div><div> Out.Int(i, 5); Out.Int(j, 5); Out.Ln</div><div> END C;</div><div><br class=""></div><div>BEGIN</div><div>END M.C</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Anyone can choose his or her favourite indentation style.</div><div class=""><br class=""></div><div class="">I personally don't like the two extremes (Daniel and Knuth / Campbell). Imho they don't follow Einstein's criterium "Make it as simple as ...": Daniel's is too simplistic and Knuth's / Campbell's are too convoluted.</div><div class=""><br class=""></div><div class="">The classic Wirth / Gutknecht style is the only style that is completely consistent: every scope has its own indentation.</div><div class="">BlackBox uses this style as standard. See: <a href="https://hansklav.home.xs4all.nl/ProgrammingConventionsBB.pdf" class="">https://hansklav.home.xs4all.nl/ProgrammingConventionsBB.pdf</a></div><div class=""><br class=""></div><div class="">Some might find the Reiser / Mössenböck styles more aesthetically pleasing because of their simplicity. Although these styles are not as consistent as the Wirth / Gutknecht style, in practice this doesn't matter much because there is only one module scope per compilation unit, and nested procedures are rarely used in Oberon programs.</div><div class=""><br class=""></div><div class="">The latter styles are used in two excellent books: <i class="">The Oberon System</i> by Martin Reiser and <i class="">Object-Oriented Programming in Oberon-2</i> by Hanspeter Mössenböck. These books are the two best typeset Oberon books there are (imho). Unfortunately both have long been out of print. A scanned copy of <i class="">The Oberon System</i> can be found on the internet here: <a href="http://oberoncore.ru/library/reiser_the_oberon_system_user_guide_and_programmers_manual" class="">http://oberoncore.ru/library/reiser_the_oberon_system_user_guide_and_programmers_manual</a> , and there's a pdf-version of <i class="">OOP in Oberon-2</i> here: <a href="http://ssw.jku.at/Research/Books/Oberon2.pdf" class="">http://ssw.jku.at/Research/Books/Oberon2.pdf</a> . In this pdf the source code indentation is not rendered entirely accurately, so also have look at a scanned version of this book: <a href="https://books.google.nl/books?id=BseoCAAAQBAJ&printsec=frontcover&dq=object+oriented+programming+in+oberon-2&hl=nl&sa=X&redir_esc=y#v=onepage&q=object oriented programming in oberon-2&f=false" class="">https://books.google.nl/books?id=BseoCAAAQBAJ&printsec=frontcover&dq=object+oriented+programming+in+oberon-2&hl=nl&sa=X&redir_esc=y#v=onepage&q=object%20oriented%20programming%20in%20oberon-2&f=false</a></div><div class=""><br class=""></div><div class="">--</div><div class="">Hans Klaver</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><div><br class=""></div></div></div></div><br class=""></div></body></html>