POV-Ray : Newsgroups : povray.advanced-users : union of unions Server Time
29 Jul 2024 12:24:21 EDT (-0400)
  union of unions (Message 11 to 20 of 43)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Rune
Subject: Re: union of unions
Date: 9 Sep 2002 19:10:19
Message: <3d7d2a5b@news.povray.org>
Warp wrote:
>   I don't know about you, but to me it's easier
> to spot an opening bracket at the same column as
> the closing one I'm looking the pair for, than
> distinguishing that some word is at the same column
> (specially when there are several blocks one inside
> another).

Nope that's not the same for me. Why would it be more difficult to
recognize a word than a starting bracket?

But really, the whole point of indention is that you *don't* need to
recognize any symbol or words in order to get an overview of the
structure. You simply need to notice that there is *something* at the
same indention level.

If you see a closing bracket and want to find the start of the block,
you simply scan upwards until you hit *anything* that is on that
indention level. So why does it make any difference what it is?

>   Have you actually looked at the documentation?
> For example look at the primitives documentation (6.5).
> About half of the examples are indented in one way and
> the other half in the other way.

Maybe so. But when you look at both the demo scenes and documentation, I
still think that my statement is correct, if we count in lines of code
(even though your indention method take up more lines!)

>   Even if "the vast majority" of people use that
> indentation style, that doesn't automatically make it good.

No, there are other reasons why it is good. It is equally* easy to read
with regard to indention, and it is more compact (without being
cluttered in any way), which mean that you can see more code in the same
view.

* at least we can't prove with objective arguments if one is easier to
read than the other.

But even if we assume that the two styles are equally good, it will
still make life easier for coders if most people used the *same* style
rather than different styles.

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

From: Slime
Subject: Re: union of unions
Date: 9 Sep 2002 19:50:29
Message: <3d7d33c5$1@news.povray.org>
> But even if we assume that the two styles are equally good, it will
> still make life easier for coders if most people used the *same* style
> rather than different styles.


To be honest, I think a more worthwhile debate would be whether to use tabs
or spaces for indentation.

Personally, I'm all for tabs.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: JRG
Subject: Re: union of unions
Date: 9 Sep 2002 20:58:21
Message: <3d7d43ad$1@news.povray.org>
"Slime" wrote:
> > But even if we assume that the two styles are equally good, it will
> > still make life easier for coders if most people used the *same* style
> > rather than different styles.
>
>
> To be honest, I think a more worthwhile debate would be whether to use tabs
> or spaces for indentation.
>
> Personally, I'm all for tabs.

Sure... but TWO SPACES tabs, mind you...

--
Jonathan.


Post a reply to this message

From: Slime
Subject: Re: union of unions
Date: 9 Sep 2002 21:48:16
Message: <3d7d4f60$1@news.povray.org>
> Sure... but TWO SPACES tabs, mind you...


Well, tab size can be set differently on different programs, can't it? So I
can set mine to 4 (which I prefer) while you can set yours to 2.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Peter Popov
Subject: Re: union of unions
Date: 10 Sep 2002 01:01:28
Message: <v1vqnuk8a6dfv8o3ubu648645kpkhr5of6@4ax.com>
On Mon, 9 Sep 2002 19:50:24 -0400, "Slime" <slm### [at] slimelandcom> wrote:

>To be honest, I think a more worthwhile debate would be whether to use tabs
>or spaces for indentation.

But they are different beasts! Or have you never edited a makefile? :)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Warp
Subject: Re: union of unions
Date: 10 Sep 2002 05:01:17
Message: <3d7db4dc@news.povray.org>
Slime <slm### [at] slimelandcom> wrote:
> Personally, I'm all for tabs.

  Yes, and then someone viewing the file with different tab settings than
you will see it in a quite funny way (specially if you combine tabs and
spaces in the indentation).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Warp
Subject: Re: union of unions
Date: 10 Sep 2002 05:10:36
Message: <3d7db70c@news.povray.org>
Rune <run### [at] mobilixnetdk> wrote:
> Nope that's not the same for me. Why would it be more difficult to
> recognize a word than a starting bracket?

  Because of its peculiar shape.
  From a bunch of text you can distinguish a lot better a '{' than a word.

> But really, the whole point of indention is that you *don't* need to
> recognize any symbol or words in order to get an overview of the
> structure. You simply need to notice that there is *something* at the
> same indention level.

  My point is that it's easier to spot that "something" if it has a peculiar
shape, like '{'.

> If you see a closing bracket and want to find the start of the block,
> you simply scan upwards until you hit *anything* that is on that
> indention level. So why does it make any difference what it is?

  *Anything* can be a lot of things and it may not always be clear which
of those things is the one you are looking for. It's easier to look for
something specific (ie. a '{') than looking for *anything*. Get my point?

> No, there are other reasons why it is good. It is equally* easy to read
> with regard to indention

  To me it's harder to read. You can't disprove that. :)

> and it is more compact

  Being more compact does not automatically mean it's better.
  If a code block is delimited by "empty" lines (not really empty, as the
line at the beginning as a { and the line at the end has a }, but as they
are the only characters at those lines, they look quite empty) it better
distinguishes the boundaries of a code block. That is, it's easier to see
where does the code block begin and where does it end.
  With the "more compact" style you don't see it as easily, as you only
have the indentation to act as a hint.

> But even if we assume that the two styles are equally good, it will
> still make life easier for coders if most people used the *same* style
> rather than different styles.

  That's why people should use the better style.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Philippe Lhoste
Subject: Re: union of unions
Date: 10 Sep 2002 06:18:27
Message: <Xns92857CFA3E789PhiLho@204.213.191.226>
Warp <war### [at] tagpovrayorg> wrote in news:3d7db4dc@news.povray.org:

> Slime <slm### [at] slimelandcom> wrote:
>> Personally, I'm all for tabs.
> 
>   Yes, and then someone viewing the file with different tab settings
>   than 
> you will see it in a quite funny way (specially if you combine tabs
> and spaces in the indentation).

I use tabs in most of my code, but I settled for spaces for POV-Ray
sources, because most people seems to use it, because 2 spaces is quite
compact with code that can be deeply nested, and because they are better
to see in newsgroups... 

I also like to align my soft brackets, and keep this notation. I believe
that such religious war is useless, because by experience everybody
keeps its opinion. After all, it is a matter of taste. 

I think that consistency is more important for an individual or a
project, that accross a community. I am trying to write code with always
the same rules applied. But when I write Scintilla or VXCL code, for
example, I follow the style used by the author. It is just polite, as it
eases the work of integrating back the patches in the code base. 

Note that mixing tabs and spaces is, for me, the worst way of
indenting... It is confusing, often inconsistent, can fool some editors,
etc. 

Regards.

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/


Post a reply to this message

From: Slime
Subject: Re: union of unions
Date: 10 Sep 2002 07:12:44
Message: <3d7dd3ac@news.povray.org>
>   Yes, and then someone viewing the file with different tab settings than
> you will see it in a quite funny way (specially if you combine tabs and
> spaces in the indentation).


Oh, well, certainly if you combine tabs and spaces. That would be stupid
though. I find the ability to view a file with different tab settings to be
an advantage.

You do have to be careful only to use tabs for indentation though, and not
formatting purposes.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Warp
Subject: Re: union of unions
Date: 10 Sep 2002 07:23:53
Message: <3d7dd649@news.povray.org>
Philippe Lhoste <Phi### [at] gmxnet> wrote:
> Note that mixing tabs and spaces is, for me, the worst way of
> indenting... It is confusing, often inconsistent, can fool some editors,
> etc. 

  Unfortunately this is what emacs does by default (and you might imagine
how many unix-users use emacs as their source code editor with default
settings...).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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