POV-Ray : Newsgroups : povray.advanced-users : union of unions : Re: (union of unions); indentation style Server Time
29 Jul 2024 14:22:54 EDT (-0400)
  Re: (union of unions); indentation style  
From: Fidel viegas
Date: 15 Sep 2002 09:19:14
Message: <B9AA4684.4AFE%fidel.viegas@artrecognition.co.uk>
I am sorry, but I have to disagree with you. The other two styles are much
more readable. But then again, if it makes you happy and you can read it,
then good for you. But, I would have to take a while to understand it,
specially if there is a lot of nested code. I can get used to it, but it
isn't as readable as the other ones.
That's just my opinion on the subject. I do respect everyone's style, but
there are some styles more readable than others.

All the best

Fidel.
 

in article 3D834E68.BA3FFD7F@computermuseum.fh-kiel.de, Frank 'Sputnik'


> Hi,
> 
> I can't decide if I should pour cold water over you all or
> throw some dynamite into the flames, so I'll try both --
> here comes the third style:
> 
> // typical indentation example
> keyword { required_parameters
> optional_parameters
> optional_parameters
> }
>
> This is completely logical, because
> - *everything* belonging to the keyword is indented,
> including, of course, the "}"
> - no (almost) empty line separates the keyword from
> its parameters
> - it's easy to find the keyword belonging to a "}":
> (1) look at the "}";
> (2) move your focus to the white space preceding it;
> (3) move your focus up over WHITE space until you see
> BLACK;
> (4) you are looking at the keyword!
> 
> It isn't a dogma to me, just a rule of thumb to improve
> readability of _my_ code. To check braces, I don't (ab)use
> my eyes; 'Match Braces' will do that faster and more reliable
> than I ever could. I don't care much about the braces -- they
> are for the _computer_, not for me; I don't need them.
> Indentation is for humans, that's all _I_ need.
> For me the most powerful formatting means is white brace-
> free space (horizontally and vertically; and comments, of
> course).
> 
> The same style can be used for other 'bracing pairs' like
> #case/#break, #if/#else/#end:
> 
> // typical indentation example
> #macro MyObject ( Para )
> DoThis
> DoThat
> #end//macro MyObject
> 
> Those who want aligned braces (and 'bracing pairs') might
> use my Pascal-Style:
> 
> /* typical Pascal indentation */
> if Condition then             begin
> DoThis
> DoThat                    end
> else                        begin
> DoOther
> DoMore                    end;
> 
> Perfectly aligned AND readable, isn't it? :))
> 
> For a real POV-Ray example see my post in p.g on 3rd sept.
> concerning with 'Intersection with quartic: bug?'.
> 
> Oh, I don't want to convince anybody that my style is the
> best -- my intention is to show the friendly coexistence
> of 3 (or more) 'truths'.
> 
> Make POV, not war!
> 
> Sputnik
> 
> 
> e-mail: fr (at) computermuseum (dot) fh-kiel (dot) de


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.