Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: Blocks for scope control Date: Fri, 20 Jan 2012 12:11:23 -0800 Organization: A noiseless patient Spider Lines: 78 Message-ID: <36ijh7lrvqs5iai84dmq10gujpeiecpps6@4ax.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="JCn9+dUdCQH+ycRezr2Sxw"; logging-data="31087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/G2KwPWgeogCcGaEQr4E6dXOyvkUOzoJQ=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:XSv8C2HD76wv0cq1fUtRL0OY4XY= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11531 On 20 Jan 2012 15:34:51 GMT, ram@zedat.fu-berlin.de (Stefan Ram) wrote: >ram@zedat.fu-berlin.de (Stefan Ram) writes: >>{ final Button button = new Button(); frame.add( button ); } > > I also use blocks to clarify the scope of a comment > (when extracting a method is no better solution): > >alpha(); >{ /* add a button to the frame */ > final Button button = new Button(); > frame.add( button ); } >beta(); I dislike block ends at the end of a line. I use blank lines myself and comment headers with bigger, oh, call them "wings". * * * This is a high-level comment. * * code code * * This is a less high-level comment. * code code * This is a fairly tactical comment. code code * This a block comment. code code && and this is a line comment. && Sometimes continued. code I usually do not use wings and rarely use two line wings. If I add a lesser comment to a winged comment, I put it after the after-wing, as in: * * This is a less high-level comment. * * If you modify this code, check over OtherCode() as well. > I teach both the use of omitable »final« keywords and the > use of omitable blocks (which both serve only to enhance > readability) in my classes right from the beginnig. In fact, > I start to teach /all/ variable declaration and parameter > declarations with »final« and later explain when »final« can > be removed. > > (Many English dictionaries do not have an entry »omitable«. > This word is intended to mean the following above: An omitable > part of the source code often [but not necessarily always] > can be removed without changing the behavior of the program.) It was surprising to me that there was apparently no such word of capable of being omitted. It turns out that it is irregular. The word you want is "omissible": http://dictionary.reference.com/browse/omissible Sincerelyk, Gene Wirchenko