octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic classdef functionality


From: Daniel Kraft
Subject: Re: Basic classdef functionality
Date: Fri, 26 Jul 2013 11:57:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

On 07/26/2013 11:48 AM, John W. Eaton wrote:
> On 07/26/2013 02:54 AM, Philipp Kutin wrote:
> 
>> IMO, indenting the braces halfway to the code of its surrounded block
>> effectively doubles the number of (imaginged) vertical lines, but adds
>> no information. Furthermore, the code in the "if" branch and the
>> "else" code are now indented differently, even they're at the same
>> "level"!
> 
> So you are objecting to the GNU coding style.  Is this the first time
> you've encountered it?

Sorry for the probably off-topic post, but since I first saw the GNU
style, it seems like the only "logical" option to me.  Before, I used the

if (something)
{
  body
}

style (don't remember how it is called) since I find putting the { on
the same line as if's or for's just looks absolutely bad.  With the
GNU-style you have basically just one single rule:

Everything that is "part" of some other construct is indented by some
amount (two spaces to be precise, but that doesn't matter for the basic
philosophy).

This is then consistently applied both to constructs like if/for *as
well as* for blocks.  Thus if you have a block, it will always look like

{
  body
}

because the body is "part of" the block.  And if you have an if, it will be

if (something)
  body
else
  other body

where body and "other body" are the parts.  If the body happens to be a
block, you get out what is the characteristic indention of the GNU
style.  And if "other body" happens to be a single line instead, you get
what was described above as "confusing" because both codes are then
indented differently--but this is consistent because both codes are
actually on *different* levels, since the body is wrapped into a block
in addition.

Yours,
Daniel

-- 
http://www.domob.eu/
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri


reply via email to

[Prev in Thread] Current Thread [Next in Thread]