POV-Ray : Newsgroups : povray.unofficial.patches : #declares and memory management Server Time
18 Aug 2024 14:22:25 EDT (-0400)
  #declares and memory management (Message 31 to 40 of 50)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Warp
Subject: Re: #declares and memory management
Date: 25 May 2001 07:13:47
Message: <3b0e3e6b@news.povray.org>
Tony[B] <ben### [at] catholicorg> wrote:
: I'll learn. :) Just let me get started somewhere... It almost sounds to me
: like Warp is saying I just can't do this... or like I need years and years
: to do it...

  I didn't say that you absolutely can't do it, period. I said that being
able to patch povray smoothly and nicely requires years of programming
experience. Making efficient and good-quality programs is not something you
learn in a couple of months.
  Of course you can achieve something that works in a rather short time if
you just keep working and studying, but to be sincere, I doubt that the
result will be the most efficient and high-quality possible.
  It can be a good way of learning, although I think that smaller projects
could be better at the beginning.

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


Post a reply to this message

From: Warp
Subject: Re: #declares and memory management
Date: 25 May 2001 07:15:56
Message: <3b0e3eec@news.povray.org>
Tony[B] <ben### [at] catholicorg> wrote:
:>   Until you have the years of programming experience needed for this,

: But I don't want to just be a passive idea-box.

  Read my "until" phrase again... :)

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


Post a reply to this message

From: Christoph Hormann
Subject: Re: #declares and memory management
Date: 25 May 2001 07:55:25
Message: <3B0E4863.4D55F28E@gmx.de>
"Tony[B]" wrote:
> 
> I'll learn. :) Just let me get started somewhere... It almost sounds to me
> like Warp is saying I just can't do this... or like I need years and years
> to do it... Can't I at least get in the swing in a few months? I won't do
> any magic, but I'll do something. That's what I mean to do. I just want to
> help.
> 

Just my not so important opinion:

I think the best way to learn how the povray source code works is to deal
with it, you even don't have to actually write a patch, just analyzing
things and studying previously made patches can give great insights.  

The first attempts to writing patches will probably always be quite clumsy
and for someone else who wants to extend them or incorporate them into his
own patch it will probably often be easier to just rewrite it from scratch
(that's about how i would judge my own attempts in that direction too). 
NTL, you will learn a lot, have (more or less :) fun and possibly help to
introduce some nice new features into POV - what do you want more?

So just get the source code, a good Editor, some good C programming
reference/book and give it a try...

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Warp
Subject: Re: #declares and memory management
Date: 25 May 2001 08:39:56
Message: <3b0e529c@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
: So just get the source code, a good Editor, some good C programming
: reference/book and give it a try...

  I personally still think that it would be better to first get
accustomed with programming (that is, you don't need to search in a book
what was the syntax of a function or a for-loop) and get some experience
before trying to handle a huge program. Better start with small programs
(like a program which prints all prime numbers between 1 and 1000 and such),
then write a bit bigger ones before even trying to patch a huge program.
It will save a lot of time in the long run and the patch will probably be
much better and efficient. If you start coding the patch from the scratch,
with no experience at all, you'll probably make things in 50 lines which
could be made in 5 lines much more efficiently and with a lot less trouble and
work.

  Of course this is only my opinion.

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


Post a reply to this message

From: Christoph Hormann
Subject: Re: #declares and memory management
Date: 25 May 2001 09:48:05
Message: <3B0E62CB.141CDEFA@gmx.de>
Warp wrote:
> 
>   I personally still think that it would be better to first get
> accustomed with programming (that is, you don't need to search in a book
> what was the syntax of a function or a for-loop) and get some experience
> before trying to handle a huge program. Better start with small programs
> (like a program which prints all prime numbers between 1 and 1000 and such),
> then write a bit bigger ones before even trying to patch a huge program.
> It will save a lot of time in the long run and the patch will probably be
> much better and efficient. If you start coding the patch from the scratch,
> with no experience at all, you'll probably make things in 50 lines which
> could be made in 5 lines much more efficiently and with a lot less trouble and
> work.

Therefore i suggested studying things before.  I never learned programming
systematically (apart from some Basic at school) and i think i learned
most about programming by studying others' code.  Some things of course
also require reading of books, but IMO that is usually an automatic
reaction when looking at the code and not understanding things (unless
there are some friendly Povers in range you can ask :-)

Learning programming systematically by reading books and doing programming
exercises is of course not bad either, but it can be quite frustrating and
it does not train you to understand code written by others.  

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 25 May 2001 10:17:02
Message: <3b0e695e@news.povray.org>
In article <3B0E4863.4D55F28E@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> The first attempts to writing patches will probably always be quite clumsy
> and for someone else who wants to extend them or incorporate them into his
> own patch it will probably often be easier to just rewrite it from scratch

And this is a problem!  Half of the patches in MegaPOV fall into this
category.  Either a specific patch was a quick hack, done with little
consideration, or, some of the bigger patches were reasonably well
implemented, but never finished, debugged, cleaned up or at least commented.

It is always harder to fix code written by someone else, and it is close to
impossible if the code is not commented and implements an unknown algorithm
(because neither code nor comments tell you anything about it).  Not to
mention that it takes an awful lot of time.  And so I continue to look into
the 'parametric' object code which refuses to work in 3.5...


    Thorsten


____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 25 May 2001 10:34:00
Message: <3b0e6d58@news.povray.org>
In article <3b0e529c@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   I personally still think that it would be better to first get
> accustomed with programming (that is, you don't need to search in a book
> what was the syntax of a function or a for-loop) and get some experience
> before trying to handle a huge program. Better start with small programs
> (like a program which prints all prime numbers between 1 and 1000 and such),
> then write a bit bigger ones before even trying to patch a huge program.
> It will save a lot of time in the long run and the patch will probably be
> much better and efficient. If you start coding the patch from the scratch,
> with no experience at all, you'll probably make things in 50 lines which
> could be made in 5 lines much more efficiently and with a lot less trouble and
> work.

I completely agree with you!

I still have tons of such code in my mailbox from people (8-10 of about 30)
who took an intro to data structures class (I was the teaching assistant)
and came up with 82 lines and three while-loops (in C) to reverse a doubly
linked list.  Then there are the "better" solutions that need one while-loop
and a function that returns the nth element (a second while-loop).  And this
in university (first year of course) so they were at least told what is
wrong with their code...

I don't want to discourage anybody.  You just should know that nobody can
learn programming in a day, week or even year.  The syntax (0.1%), yes, but
there is a lot more behind it (99.9%).  After five or ten years there will
still be things left to learn!

    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: Thorsten Froehlich
Subject: Re: #declares and memory management
Date: 25 May 2001 10:46:00
Message: <3b0e7028$1@news.povray.org>
In article <3B0E62CB.141CDEFA@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> Therefore i suggested studying things before.  I never learned programming
> systematically (apart from some Basic at school) and i think i learned
> most about programming by studying others' code.  Some things of course
> also require reading of books, but IMO that is usually an automatic
> reaction when looking at the code and not understanding things (unless
> there are some friendly Povers in range you can ask :-)

This is very true.  Reading other code speeds up learning, and in fact that
is how I started (and still learn i.e. how to use some API), too.
Nevertheless, it is much easier with Basic than with C.  Further, studying
small examples help, but studying a big piece of code like POV-Ray, with all
the complex interactions and side effects you have to think about takes much
longer than learning from small examples.  Also, the POV-Ray source code is
not the ideal code in many ways - it developed over years, and many of its
tricks and tweaks would never be used in a rewrite because they are simply
far, far away from being ideal.

> Learning programming systematically by reading books and doing programming
> exercises is of course not bad either, but it can be quite frustrating and
> it does not train you to understand code written by others.

I think this really depends on the book.  There are a lot of bad books out
there (i.e. 1000+x books about Java, but only four or five are good) and
picking the right one can be very hard, even for someone who knows the stuff
already and "only" has to pick for a book others!

    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: Warp
Subject: Re: #declares and memory management
Date: 25 May 2001 10:50:28
Message: <3b0e7134@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
: I still have tons of such code in my mailbox from people (8-10 of about 30)
: who took an intro to data structures class (I was the teaching assistant)
: and came up with 82 lines and three while-loops (in C) to reverse a doubly
: linked list.  Then there are the "better" solutions that need one while-loop
: and a function that returns the nth element (a second while-loop).  And this
: in university (first year of course) so they were at least told what is
: wrong with their code...

  This is exactly what I meant.

  I don't think it's a very good idea to hurry too much. I know that the
idea of making a POV-Ray patch is exciting, but in the long run too much
hurry causes more problems than it's worth.
  If the goal is to learn programming, there are much better ways of doing
it than go straight to POV-Ray source code and try to understand it. POV-Ray
is huge and made by many people and it uses very complicated algorithms
which are not easy to understand. Trying to deal with all this in a state
where you are still trying to remember how to write a function can be just
too much.

  Of course you can try if you want. Who am I to stop you anyways? I'm just
trying to give advice based on my own experience.

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


Post a reply to this message

From: Ken
Subject: Re: #declares and memory management
Date: 25 May 2001 20:36:07
Message: <3B0EFB3A.7BD8805A@pacbell.net>
Thorsten Froehlich wrote:

> I don't want to discourage anybody.  You just should know that nobody can
> learn programming in a day, week or even year.  The syntax (0.1%), yes, but
> there is a lot more behind it (99.9%).  After five or ten years there will
> still be things left to learn!

Sounds a lot like POV-Ray to me :)

-- 
Ken Tyler


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.