POV-Ray : Newsgroups : povray.advanced-users : A point on programming Server Time
2 Nov 2024 15:23:50 EDT (-0400)
  A point on programming (Message 1 to 4 of 4)  
From: Matt Giwer
Subject: A point on programming
Date: 9 Aug 1999 12:04:53
Message: <37AEFC29.C61C5047@giwersworld.org>
I have never made a living by programming but 32 years ago in
October my first FORTRAN program compiled and ran as required on
an RCA time share computer. I used a teletype machine with an
acoustic couple 300 baud modem. Those old chunche chunck chuncks
you hear I heard. 

	To the point, many people keep asking how to do this and that
"their" way. Their way may not be possible. I remember BYTE
running a contest (not prizes but recognition for first
submission) of different ways to do a LOOP. There were over 120
different ways that they published. I remember questioning a few
of them as being different but at least 100 were legit. And that
was without C code type differences. i=i+1 and i+ were considered
the same before publication. 

	So when people post asking who to do what they are familiar with
in this language, the impolite person says to learn a few more
languages. But there are so many people who do not know any
language that answer is unfair. 

	So far as I have used the interpreter routines, what exists in
POV 3.x is closest to an assembly routine. Do not expect things
to take care of you. Expect to take care of them yourself. 

	The good news for those not knowing a computer language is that
the WHILE implementation is what serious programers learn to get
around if they are stuck with a real high level language. 

	What I am trying to say is that if you master the POV WHILE you
will later view every other loop as something making it easier
for you to do; something that is holding your hand, a shortcut. 

	As another point, there is no reason to put a routine outside of
your loop as a macro unless there is a conditional inside your
loop to do to different macros. Programming is not a college
test. Programming is productivity. 

	People have asked how to do that. First ask why do that. Even
with an #IF statement they can be done inside the loop. 

	I am not trying to define the language but rather, if you know
enough to ask that kind of question, you should know the answer
UNLESS you are trying to copy someone else's code. 

	Start over, simplify, get back to basics.

-- 
<blink>-------please--don't-----------------</blink>

http://www.giwersworld.org/artii/
http://www.giwersworld.org/artiii/

Finally up on 99/06/22 updated 07/13


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: Nieminen Mika
Subject: Re: A point on programming
Date: 10 Aug 1999 03:35:47
Message: <37afd653@news.povray.org>
Matt Giwer <mgi### [at] giwersworldorg> wrote:
: 	As another point, there is no reason to put a routine outside of
: your loop as a macro unless there is a conditional inside your
: loop to do to different macros.

  There is one important (and sufficient) reason: Modularity.
  Dividing your code into small modules (even if you use that module in
only one place in your main code) will save you from lots of trouble if
your code grows quite big. It also makes it easier to modify your code
afterwards (specially if you use the module in more than one place but
also if you only use it in one place, since you can find it more easyly).

: Programming is not a college
: test. Programming is productivity. 

  You can do good programming and you can do bad programming. It's not about
college tests or anything. It's about making your own life easier. They
teach good programming for a reason.

-- 
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: Matt Giwer
Subject: Re: A point on programming
Date: 10 Aug 1999 07:05:51
Message: <37B0079B.613E0D39@giwersworld.org>
Nieminen Mika wrote:

> Matt Giwer <mgi### [at] giwersworldorg> wrote:
> :       As another point, there is no reason to put a routine outside of
> : your loop as a macro unless there is a conditional inside your
> : loop to do to different macros.

>   There is one important (and sufficient) reason: Modularity.
>   Dividing your code into small modules (even if you use that module in
> only one place in your main code) will save you from lots of trouble if
> your code grows quite big. It also makes it easier to modify your code
> afterwards (specially if you use the module in more than one place but
> also if you only use it in one place, since you can find it more easyly).

	I would not disagree in the least. I was attempting to point out
to people who are not into programming and do not want to get
into programming that some things they see in scene files are not
the only way or the easiest way to do things. 

	What got my attention was the comment that introduced a separate
#MACRO outside of a loop when he is just asking how to do a
#WHILE. Modularity, reusability, transportability, encapsulation
are all good ideas for people into programming. And anyone
learning programming needs be indoctrinated early. 

	But they are also taught step by step and preferably not
introduced to a new concept until they have half an idea of how
it will help them. 

	My intent was to point out that it does not have to be as
complicated as some people were making it sound in their replies.
I was addressing keeping the answer simple. Not to make the
answer more complicated than the person needs to do the project.
Once successful in simple projects, then add the more advanced
material.


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: Chris Huff
Subject: Re: A point on programming
Date: 10 Aug 1999 20:48:45
Message: <37B0C88D.64641BEE@compuserve.com>
I think you are probably talking about my message. :-)
I was simply trying to demonstrate both macros and loops, I didn't mean
to make it look like only a macro  could be used in a loop.


Post a reply to this message

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