POV-Ray : Newsgroups : povray.general : How about $ for declare? : Re: How about $ for declare? Server Time
3 Aug 2024 00:23:16 EDT (-0400)
  Re: How about $ for declare?  
From: Brian Elliott
Date: 14 Aug 2004 06:20:36
Message: <411de774@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote in message
news:411### [at] hotmailcom...
> Rafal 'Raf256' Maj wrote:
> >
> > Btw, how about adding some shorten forms for long and often used
keywords,
> > it could spedd up typing and comforable level of hand-typing .pov code,
> > like
>
> Better yet, why not have the ability to make new #aliases for keywords.
> Something like this:
>
> #alias sphere=sph;
>
> sph{ <0,0,0>, 10 pigment{White} }
>
> -Sam
>

Hello all,

Some cautionary words.

Aliasing sounds really beguiling, because being IT/Comp/Sci/Tech types,
we're all lazy when it comes to typing and repetition, and we tend to like
using the shortest sequence of keystrokes to create our code.   :-)

But on reflection (argh a RT pun), I believe it could unleash a bad genie on
the PoV-Ray community.  The genie's curse will be reduced legibility and
portability of the SDL.

Human nature being what it is, what'll happen is that the single PoV-Ray
language we have now will be replaced by a multitude of personal dialects,
as people make up whatever words they personally enjoy.  Instead of
"sphere", some will use "sph"; or "sp"; and there will be those who
particularly enjoy terse and dense code, who will condense it to a mere "s".
Authors from non-English origins might customise the SDL for their own
convenience, and use, eg., "esfera" instead!

This is perfectly fine if it is confined to one's own bedroom or study, but
there's an intensely active and diverse community around PoV-Ray and, let's
face it, this code will be shared on the Internet!

When reading someone else's aliased code, to ensure you understand their
typography, you must first seek and refer to their dictionary before you can
to understand the SDL body -eg. When this author writes "sp" on line 145 of
"myscene.pov" or "includefile3.inc", does it mean a "sphere" or a "spline"
or a locally-declared object type?

Also, consider portability:  Incorporating aliased segments of another
author's code into your work, which is either not aliased or uses different
conventions, will no longer be a simple drop-in operation -- it will be much
harder to port.

Imagine using code from three sources, created with three different
conventions.  What will you have to do to get it to work in your designs?
Especially if their "dictionary" is tucked away in a minor include file
somewhere, or it's spread across multiple files of hundreds of lines.  If
one of your sources aliased "sphere" with "sp" while another had aliased
"spline" with "sp", and you are trying to merge the two into a new scene or
into your whole code library, you have a real mess to sort out!!!

The end effect:  I think there are many people who would discard such code
rather then face the extra time and frustration of translating it.  Great
ideas could be discarded or not even looked at, because the author used
idiosyncratic language.  The free community exchange of ideas that happens
now would probably be reduced if aliasing were common, and I think that
would be a great pity if it happened.

Alternately, if you had aliased code and wanted to offer your creation into
the public community, you might have to convert it bact to standard syntax
first, nullifying any gains you originally got from it, either in time-saved
or visuals.

My sense of it is that the disadvantages eventually outweigh the advantages.

$0.02
Cheers,
  Brian


Post a reply to this message

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