POV-Ray : Newsgroups : povray.text.scene-files : Eyeball code. Server Time
29 Jul 2024 02:24:08 EDT (-0400)
  Eyeball code. (Message 21 to 30 of 40)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Samuel Benge
Subject: Re: Eyeball code.
Date: 21 Jun 1999 21:57:37
Message: <376EEDFF.760FFBBB@aol.com>
Nieminen Mika wrote:

>   Since I like to show examples about this, here is one again:
>
> #ifdef(Im) #declare a=zr*zr; #declare b=zi*zi; #declare zi=2*zr*zi+Im;
> #declare zr=a-b+Re; #declare n=n+1; #if(n<9 & a+b<4) #include "obfmand.pov"
> #else sphere {<Re,n/20,Im>,.05 pigment{rgb <n/9,0,0>} finish{specular .5}}
> #debug substr(c,n,1) #declare Re=Re+.05; #end #else #declare c=" .,-=OXM#"
> #declare Im=-1; #while(Im<=1) #declare Re=-2; #while(Re<=1) #declare zr=Re;
> #declare zi=Im; #declare n=0; #include "obfmand.pov" #end #debug "\n" #declare
> Im=Im+.05; #end camera { location <-3,5,-5> look_at -x*.5 angle 35 }
> light_source { <100,100,0> 1 } #end

Is that how my code is read by you guys? I don't indent things, but I do keep
certain things on their own lines, if you know what I mean.

By the way, does Netscape have a signature feature so I don't have to keep writing
my name and e-mail?

SamuelT

STB### [at] aolcom


Post a reply to this message

From: Morpheus Dreamlord
Subject: Re: Eyeball code. and indents
Date: 21 Jun 1999 22:10:03
Message: <376EF072.98A4DC86@excite.com>
I'd like to see a atandard which includes comments on NEW lines (the are
SO easy to remove then)

Bob wrote:
> 
> Some people comment the ends of those blocks, ie.
> 
> union {
>  sphere {0,1}
>  box {-1,1}
> } //union
> 
> to make certain of where things are, but that is a bit of overkill if the script has
> been written out nicely enough to see what's what. Hey, here's a thought. What if
> POV-Ray could see these in a parse (oops, yeah it does already) and write into your
file
> this sort of thing automatically. Switchable of course for the dislikers of extra
wasted
> space.
> 
> Nieminen Mika wrote:
> >
> > Ken <tyl### [at] pacbellnet> wrote:
> > : The biggest problem then lies with the fact that there is no agreement
> > : as to what constitutes "proper" indentation. No one seems to be able
> > : to agree on that either.
> 
> Bob here again, writes:
> Remember, there's the POV-Ray code setting in the CodeMax editor. No choice there,
love
> it or leave it (or further edit what it gives you, my personal favorite).
> 
> >   A "proper" indentation is one which allows you to easyly see where does
> > a block start and where does it end without having to search through the
> > entire code (ie. you can just skip the majority of the code if you only
> > want to see where does the block end). This is speacially important with
> > nested blocks. You only need 3 or 4 levels of nesting for the non-indented
> > code to be almost completely unreadable.
> >   This same indentation of nested blocks is also used in other places than
> > programming, for example the html lists (see for example the povVFAQ page).
> > The indentation of blocks makes it easy to "parse" the contents of the
> > text. You can easyly see the "title" of each block and choose the block
> > you want.
> >   This same principle applies to code (povray or whatever). The command
> > at the beginning of a block is the "title" of that block (for example
> > "#while" or "sphere"). If you are not interested in that block you can
> > easyly skip it and go to the next block.
> >   Now, this skipping is very hard if you can't see where does the block end.
> > It's extremely tedious to search through the entire text to see where does
> > the next block begin.
> >   Just imagine a newspaper with _all_ its text without titles, blocks,
> > columns, newlines, empty lines, etc. Searching for certain news could be
> > extremely tedious. The same applies to pov-code.
> >
> 
> --
>  omniVERSE: beyond the universe
>   http://members.aol.com/inversez/homepage.htm
>  mailto://inversez@aol.com?Subject=PoV-News

-- 

Politicians - It seems to me that the worst of them could convince me
that horse shit tastes like honey-cake; the best of them would leave
me believing that I alone in all the world had failed
to enjoy its flavour.

The individual is more important then the state!


Post a reply to this message

From: Morpheus Dreamlord
Subject: Re: Eyeball code.
Date: 21 Jun 1999 22:11:26
Message: <376EF0C7.9658B2AD@excite.com>
Yup, edit - prefs - mail 7 news - identity, down the bottom you add the
local address for a text sig file.

Samuel Benge wrote:
> 
> Nieminen Mika wrote:
> 
> >   Since I like to show examples about this, here is one again:
> >
> > #ifdef(Im) #declare a=zr*zr; #declare b=zi*zi; #declare zi=2*zr*zi+Im;
> > #declare zr=a-b+Re; #declare n=n+1; #if(n<9 & a+b<4) #include "obfmand.pov"
> > #else sphere {<Re,n/20,Im>,.05 pigment{rgb <n/9,0,0>} finish{specular .5}}
> > #debug substr(c,n,1) #declare Re=Re+.05; #end #else #declare c=" .,-=OXM#"
> > #declare Im=-1; #while(Im<=1) #declare Re=-2; #while(Re<=1) #declare zr=Re;
> > #declare zi=Im; #declare n=0; #include "obfmand.pov" #end #debug "\n" #declare
> > Im=Im+.05; #end camera { location <-3,5,-5> look_at -x*.5 angle 35 }
> > light_source { <100,100,0> 1 } #end
> 
> Is that how my code is read by you guys? I don't indent things, but I do keep
> certain things on their own lines, if you know what I mean.
> 
> By the way, does Netscape have a signature feature so I don't have to keep writing
> my name and e-mail?
> 
> SamuelT
> 
> STB### [at] aolcom

-- 

Politicians - It seems to me that the worst of them could convince me
that horse shit tastes like honey-cake; the best of them would leave
me believing that I alone in all the world had failed
to enjoy its flavour.

The individual is more important then the state!


Post a reply to this message

From: MrEdd
Subject: Re: Eyeball code.
Date: 22 Jun 1999 14:42:03
Message: <376fd8fb@news.povray.org>
As long as someone that knows POV but has never seen your code before can
read it fine then your indentation is proper.
If people don't like the space it takes then why do they use comments?


Post a reply to this message

From: Morpheus Dreamlord
Subject: Re: Eyeball code.
Date: 23 Jun 1999 07:11:08
Message: <3770C0AC.9294CB70@excite.com>
I don't...

MrEdd wrote:
> 
> As long as someone that knows POV but has never seen your code before can
> read it fine then your indentation is proper.
> If people don't like the space it takes then why do they use comments?

-- 

Politicians - It seems to me that the worst of them could convince me
that horse shit tastes like honey-cake; the best of them would leave
me believing that I alone in all the world had failed
to enjoy its flavour.

The individual is more important then the state!


Post a reply to this message

From: Jon A  Cruz
Subject: Re: Eyeball code.
Date: 23 Jun 1999 23:22:34
Message: <3771A490.F4CDA4D6@geocities.com>
Ken wrote:

> Nieminen Mika wrote:
>
> >   Indentation seldom adds newlines but only spaces at the beginning of
> > the lines, so with properly indented code you will se exactly as much code
> > is with your style.
>
> The biggest problem then lies with the fact that there is no agreement
> as to what constitutes "proper" indentation. No one seems to be able
> to agree on that either.

For code in general, studies have found that from 2 to 6 spaces is optimal.

At least that narrows things down a _tiny_ bit.

(Personally, I usually use 4 for C/C++, Java, etc.  (Often only 2 for .POV
code, but then more spaces seem to help with deeper indentation)


Post a reply to this message

From: *Sigh*
Subject: Re: Eyeball code.
Date: 26 Jun 1999 07:40:45
Message: <3774BCB3.DD92DFD@paradise.net.nz>
Ken wrote:
>   Actually his non indented code looks perfectly natural to me. It drives
> other people nuts though especialy people with a programming background.

Ugh, I have a programming background and hence understand the importance of
INDENTATION!!!!!

I'm sorry, but do you have a programming background Ken?  And you don't use
indentation in your code?  And other people who look at your code are okay with
this?  And you can find when the four nested for loops begin and end?

Ceeeerrazy! ;)

P.S - I just noticed, when I try to type loud, I press the keys harder.   Ugh,
crazy human mind, like waving around the controller when you're playing Gran
Turismo ;)

-- 
That is all

*Click*


Post a reply to this message

From: Ken
Subject: Re: Eyeball code.
Date: 26 Jun 1999 08:07:38
Message: <3774C2E1.9B53D847@pacbell.net>
*Sigh* wrote:
> 
> Ken wrote:
> >   Actually his non indented code looks perfectly natural to me. It drives
> > other people nuts though especialy people with a programming background.
> 
> Ugh, I have a programming background and hence understand the importance of
> INDENTATION!!!!!
> 
> I'm sorry, but do you have a programming background Ken?  And you don't use
> indentation in your code?  And other people who look at your code are okay with
> this?  And you can find when the four nested for loops begin and end?
> 
> Ceeeerrazy! ;)

  It is very easy to tell when a loop ends. The Pov team implemented a
very special key word for this called #end. For every #while there must
be one #end. If you are mathmaticaly inclined enough to count up to
four #while's you should be able to count up to four #end's indented
or not. Go figure !

 
> P.S - I just noticed, when I try to type loud, I press the keys harder. Ugh,
> crazy human mind, like waving around the controller when you're playing Gran
> Turismo ;)

  I always type loud because of my piano playing background thought it does
sound better on the keyboard.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Nieminen Mika
Subject: Re: Eyeball code.
Date: 26 Jun 1999 09:34:03
Message: <3774d6cb@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
:   It is very easy to tell when a loop ends. The Pov team implemented a
: very special key word for this called #end. For every #while there must
: be one #end. If you are mathmaticaly inclined enough to count up to
: four #while's you should be able to count up to four #end's indented
: or not. Go figure !

  So instead of just directly seeing the proper #end keyword at the first
sight, you have to be counting the number of #end statements.
  Suppose something like this:

#if(something)
#while(this)
#if(some_else)
#while(that)
#if(foo)
bar
#end
#if(bar)
foo
#end
#end
#if(foo)
bar
#end
#end
#if(bar)
#while(that)
#if(foo)
bar
#end
#end
#end
#end
#end

  Where does the first "#while(that)" end? How about the first #if?
  For example in the case of the first #if statement you could instaneously
say where does it end with a proper indentation. Without indentation you
can't be sure before you count all the blocks.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Eyeball code.
Date: 26 Jun 1999 09:41:45
Message: <3774D8F1.718F5C3A@pacbell.net>
Nieminen Mika wrote:

>   So instead of just directly seeing the proper #end keyword at the first
> sight, you have to be counting the number of #end statements.
>   Suppose something like this:

>   Where does the first "#while(that)" end? How about the first #if?
>   For example in the case of the first #if statement you could instaneously
> say where does it end with a proper indentation. Without indentation you
> can't be sure before you count all the blocks.
> 
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/

  This one is easy to answer. I don't know how to use the #if function in
pov so I wouldn't understand it if it was properly indented or not. This
leaves me without a basis to argue for or against your own argument.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


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.