POV-Ray : Newsgroups : povray.advanced-users : union of unions : Re: union of unions Server Time
29 Jul 2024 16:22:15 EDT (-0400)
  Re: union of unions  
From: Rune
Date: 10 Sep 2002 18:00:50
Message: <3d7e6b92@news.povray.org>
Warp wrote:
>   I don't understand this. If you are told "look for
> *anything* at this indentation level", I think that's
> a bit slower task to do than "look for a { at this
> indentation level". With the later you are only
> searching for a specific character (which is usually
> easy to spot) and you can just visually skip anything
> else. With the former you can't skip anything, but
> you have to visually check everything that could be a
> candidate for what you are searching for.

There are no "candidates". It's always the first thing you find (on that
indention level), which is what you're looking for. It's not like these
are several things you have to look at, and then figure out which one is
the correct one.

> Also your indentation is more illogical.

By your definitions.

> The starting character of the code block is
> completely disconnected from the code block in question

I see the { character as an extension of the keyword coming before it,
and that marks the start of the block. The } character marks the end of
the block. The line defining the start of the block is on the same
indention level as the line defining the end of the block. This is
completely logical.

I acknowledge that your style is also completely logical, I just prefer
the style I use for several other reasons.

> The starting character is also completely and arbitrarily
> misplaced with respect to the ending character.

I really don't know what you mean.

> IMO it's more logical that the starting character
> of the code block is always located at the same
> place with respect to to the code block and the
> block ending character.

In the style I use, the starting *line* of the code block (keyword + {)
is always located at the same place with respect to the code block as
the block ending *line* (})

>   When someone posts a povray code showing some
> problem and I need to read the code and understand
> it, usually the first thing I have to do is to
> re-indent it by placing the brackets in their
> proper places.

Same here.

> That way it's a lot easier to see matching pair
> and, for example, if an opening bracket is
> missing or whatever. It's a lot more difficult
> to understand the code indented in your way.

In my experience, it's more difficult to understand the code in *your*
way. People are different.

>   On the other hand, I don't remember anyone
> complaining that my way is more difficult to
> understand. (Of course you could complain as a
> reply to this, but I think that would be quite
> artificial.)

Well, there was that one time where you had missed a closing bracket in
your code. There's a slight chance that it may have been someone else,
but I'm pretty sure it was you. My point below is valid either way.

Back then, it *did* take me a long time to find the error, because I
found the indention confusing, and I did indeed reindent the code to be
able to find it. However, as I respect your choice (or whoever it was)
to use a different style, I certainly didn't "complain", and still
don't. I would find it rather rude if people complained about the coding
style I have chosen to use, since it makes perfectly sense and is even
widely used.

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com (updated Sep 8)
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

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