POV-Ray : Newsgroups : povray.pov4.discussion.general : Random POV-Ray 4 SDL proposal, #2 : Re: Random POV-Ray 4 SDL proposal, #2 Server Time
15 Jun 2024 09:54:28 EDT (-0400)
  Re: Random POV-Ray 4 SDL proposal, #2  
From: William F Pokorny
Date: 14 Dec 2015 13:31:07
Message: <566f0aeb$1@news.povray.org>
On 12/14/2015 09:50 AM, scott wrote:
>>> All object properties are set via identifier, rather than anonymlously
>>> by position; for instance, instead of
>>>    sphere { CENTER, RADIUS }
>>> it will be:
>>>    sphere {
>>>      center: EXPRESSION ;
>>>      radius: EXPRESSION ;
>>>    }
>> I personally like this form though more verbose. Any syntax more
>> explicit about what property is being set is much clearer to new users
>> especially - expect many periodic users too.
> Why not allow both styles? Is there any benefit to forcing one way or
> the other?

I fully expect any new SDL would allow both styles.

The advantage of the more verbose form gets to my question as to whether 
part of the aim of a new SDL is to make it easier for new users / 
non-programmers to use POV-Ray. The tendency for us as experienced users 
is to think specifically about what we most want going forward.

Is part of the aim of a new SDL to broaden usage? If the answer is yes, 
I think this goal should influence the form any new SDL takes. In part 
doing this by enabling a default style of coding which is more explicit, 
more flexible and forgiving as to order and specification.

Today we have things like map types, interpolation types which are just 
numbers. There are rules to position and order such as where gamma must 
be specified within an image_map. We get used these rules, but they are 
just requirements driven/caused by our current SDL implementation. 
Requirements which make it harder for the new or casual user to join us 
on the ray-tracing playground.

Even with todays sphere syntax, suppose a new user sees sphere { 0.2, 
0.5 }, and tries to guess implementation. The programmer oriented short 
cuts are no doubt helpful for those coding daily, but they come at the 
loss of clarity for those not.

Side story: When I started my first real job out of school I had a pile 
of test data I needed to munge. I mentioned what I needed to an older 
co-worker - who seemed really old to me at the time at probably 40 - and 
he said, "that's easy with a little APL." We went to his office and to 
his special keyboard with the APL character support. In about 10 minutes 
we had a single line of code maybe 60 characters long that did 
everything I wanted & more. I was dumbfounded. I'd written code in 
Assembler, Basic and Fortran by the point, but I'd had no prior exposure 
to APL. That line of APL was a magic incantation.
>> Perhaps it is just my long term memory is less capable than others, but
>> after being away from POV-Ray for a time I always find myself again
>> looking up syntax for things. Why my own SDL generating code tends to
>> look like:
> The problem is though, you'll forget whether the parameter is called
> "center", "position", "location" or "centre", and then have to look it
> up anyway. And that's for something simple like a sphere. Imagine you
> come to include something as horrendously complex as a cylinder or cone
> in your scene, what are the parameter names for the two end points?
> Personally I find it far easier to remember the order of parameters than
> the names.
If coming to a clean slate and not returning to existing code that can 
certainly be true. Where I have coded wrappers for POV-Ray language 
elements, my look up for valid options is : DefSphere -h so not too bad, 
but yep, nothing perfect and our preferences will differ.

Bill P.

Post a reply to this message

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