<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="">Hi<div class=""><br class=""></div><div class="">Indentation is indeed a totally personal thing.<div class="">The compiler doesn’t need indentation at all, you could write your whole module on one line :-)</div><div class=""><br class=""></div><div class="">There are certain indentations N. Wirth uses, I personally don’t like:</div><div class="">Eg. N Wirth starts with the first statement directly behind the BEGIN.</div><div class="">My BEGINs are on their own line, as well as the corresponding ENDs. All line between BEGIN and END are indented by one tab.</div><div class=""><br class=""></div><div class="">I indent procedures as follows</div><div class="">PROCEDURE test*;</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>VAR</div><div class=""><span class="Apple-tab-span" style="white-space:pre">               </span>i: INTEGER;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">               </span>s: ARRAY 20 OF CHAR;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>BEGIN</div><div class=""><span class="Apple-tab-span" style="white-space:pre">             </span>i := 1;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">           </span>s := „Hello World“;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>END test;</div><div class=""><br class=""></div><div class="">The procedure header of a top level PROCEDURE is NOT indented, it starts at the beginning of the line.</div><div class="">The CONST, TYPE, VAR, BEGIN and END of the procedure are indented once relative to its procedure header.</div><div class="">If I have one variable, I write it directly behind the VAR. If there are more, I indent all variables once relative to the VAR.</div><div class="">if I have a short statement in an IF, I write the whole IF THEN END  on one line as I see it as one construct.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>IF i < 100 THEN INC(i) ELSE i := 0 END;</div><div class=""> </div><div class="">If the statements are longer I put the statements on separate lines indented once relative to its IF END.</div><div class="">If the two parts of the THEN and ELSE are very different in length I prefer a short THEN and a long ELSE. As an example</div><div class=""><br class=""></div><div class="">Instead of this</div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>IF i = 0 THEN</div><div class=""><span class="Apple-tab-span" style="white-space:pre">             </span>statement1;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">               </span>statement2;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">               </span>statement3;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">               </span>statement4</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>ELSE</div><div class=""><span class="Apple-tab-span" style="white-space:pre">              </span>Error(15)</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>END</div><div class=""><br class=""></div><div class="">I use this form if possible:</div><div class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>IF i # 0 THEN Error(15)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>ELSE</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">            </span>statement1;</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">             </span>statement2;</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">             </span>statement3;</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">             </span>statement4</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>END</div></div><div class=""><br class=""></div><div class="">br</div><div class="">Jörg</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 23.07.2017 um 03:13 schrieb Hans Klaver <<a href="mailto:hklaver@dds.nl" class="">hklaver@dds.nl</a>>:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Peter Easthope wrote:<div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="">Is there a convention for indentation?  Two blanks for each step? <br class="">Four blanks for each step?  A tab character for each?  Entirely <br class="">personal preference?<br class=""></div></div></blockquote></div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal;" class="">The only relevant convention that I'm aware of is the text "Programming Conventions" of BlackBox Component Framework, which states under 10 White Space: "<span style="background-color: rgb(255, 255, 255);" class="">A new indentation level is realized by adding one further tabulator character". </span></div><div style="margin: 0px; line-height: normal;" class=""><span style="background-color: rgb(255, 255, 255);" class="">This text mostly follows the source code formatting used by prof. Wirth.</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class="">In my experience indentation with blanks only works well with monospaced fonts (e.g. Courier).</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">The Oberon Wikibook and major Oberon textbooks preferably use a proportional font (e.g. Helvetica or Times) for Oberon source text.</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">Changing a tab character into a fixed number of blanks is done easily automatically, but changing a number of blanks in a text set in a proportional font into the right number of blanks or tab characters for any other font to get a nicely indented text must nearly always be done manually.</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">Therefore I would suggest to use one tab character for each indentation.</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">--</div><div style="margin: 0px; line-height: normal;" class="">Hans Klaver</div><div class=""><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; min-height: 14px;" class=""><br class=""></div></div></div></div>--<br class=""><a href="mailto:Oberon@lists.inf.ethz.ch" class="">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br class=""><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" class="">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br class=""></div></blockquote></div><br class=""></div></div></body></html>