April 27, 2008 Re: Normalizing Const Syntax. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote: > Georg Wrede wrote: > >> Only an idiot would spread the attribute over several pages. >> >> This of course means that if one has a class or simply a list of definitions, that starts to grow multi-line, there comes a point where the attribute envelope should be deleted and the definitions attributed individually. (A good text editor should do this, btw.) > > Good point. A rule of thumb may be that the attribute should never be more than 1/2 a page of code away from where it applies. If it starts to get more than that, then you should switch your style (perhaps to labeling every function a la Java.) > > --bb Proponents of attribute blocks might say that one of the intended uses of it is when you have lots of declarations (ie, more that 1/2 pages of code). Anyways, I'm also not a fan of attribute blocks. For one reason, because I like each definition to be self-contained. Second, because I like to group related functions together, and often these groups have mixed protections (private, public, protected, etc.). If I was to use attribute blocks I would have to bundle all private methods of the scope together, all public methods together, etc.. -- Bruno Medeiros - Software Developer, MSc. in CS/E graduate http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply