POV-Ray : Newsgroups : povray.advanced-users : union of unions Server Time
29 Jul 2024 16:29:26 EDT (-0400)
  union of unions (Message 14 to 23 of 43)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

From: Warp
Subject: Re: union of unions
Date: 10 Sep 2002 07:24:47
Message: <3d7dd67f@news.povray.org>
Slime <slm### [at] slimelandcom> wrote:
> 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.

  The problem is that the "standard" tab setting is 8 spaces, which is a bit
too much for code indentation...

-- 
#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

From: Thorsten Froehlich
Subject: Re: union of unions
Date: 10 Sep 2002 11:16:57
Message: <3d7e0ce9@news.povray.org>
In article <3d7db4dc@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   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).

Yes, but the point is to use tabs for _indentation_, not for anything else.
For indentation it does not matter.  If you use tabs to create columns (i.e.
when commenting), you of course run into trouble.  But for pure identation
that starts at the beginning of a line tabs work just fine.  Plus they parse
a tiny bit faster ;-)

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Rune
Subject: Re: union of unions
Date: 10 Sep 2002 11:32:25
Message: <3d7e1089@news.povray.org>
Warp wrote:
> My point is that it's easier to spot that "something"
> if it has a peculiar shape, like '{'.

(1) That's a statement not supported with an objective argument. I
happen to disagree.

>   *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.

(2) The one that's on the same indention level?

> It's easier to look for something specific
> (ie. a '{') than looking for *anything*.
> Get my point?

No. See (1) and (2).

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

Correct. :)

> Being more compact does not automatically mean it's better.

If and only if the readability is the *same*, then it is better if the
code is compact at the same time.

Since it seems to be a subjective matter whether or not the compact
style is better or worse with regard to readability, we may as well look
apart from that discussion.

So we have style 1 which some people find more readable but which is not
very compact.

And we have style 2 which some people find more readable and which is
also more compact.

That leaves one advantage to style 2.

> That's why people should use the better style.

"Better" is a subjective term. "Widely used" is a rather objective term,
and very often, things are widely used for a good reason. And I don't
think there is any doubt about which POV-Ray style is more 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

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

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