POV-Ray : Newsgroups : povray.general : How about $ for declare? Server Time
2 Aug 2024 22:17:59 EDT (-0400)
  How about $ for declare? (Message 28 to 37 of 37)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Doppelganger
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 23:35:20
Message: <411ed9f8$1@news.povray.org>
>More comfortable work = more time to concentrate on picture itself.

this is only true for short term work. though I'm not a POV-Ray expert, my
experience with other languages in which shorthand syntax exists makes me
say that it's only "comfortable work" for 2 or 3 lines worth of code in
every 500. The code with dense shorthand easily becomes cluttered and
impossible to read.

Giving an example of how bad short hand can be in Mathematica code (and I
tried using this sort of code for serious programming -- to give up
reasonably soon afterwards):

Compare:

f[x_]=x^2;
list=Map[f,{1,2,3,4}];
Apply[Plus,list];
list

With:

Plus@@((#^2)&/@{1,2,3,4})

they both get the list {1, 2, 3, 4}, square all entries, and sum all the
entries. Which code segment do you think you'd understand for what it is 2
months after you'd written it? I had to rtfm to get the second one right to
make this point (though I wrote fluently like it when I used it), whereas
the first one came naturally.

> > Because it is a bloat-feature based in a bloat mentality
>
> ?

it's a non-feature. It's not necessary, hardly useful, and it makes (as
illustrated) for more hard than good.


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How about $ for declare?
Date: 15 Aug 2004 23:10:17
Message: <41202599@news.povray.org>
So it's not so good idea. I AM lazy but you are right.

--
- Nicolas Alvarez
nicoalvar0 [at] hotmail [dot] com



news: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

From: Nicolas Alvarez
Subject: Re: How about $ for declare?
Date: 15 Aug 2004 23:14:05
Message: <4120267d@news.povray.org>
I'm working on a typing test (in HTML and Javascript). It's a modification
of one found in http://javascriptsource.com.

If you are interested, mail me.

--
- Nicolas Alvarez
nicoalvar0 [at] hotmail [dot] com



news:411df175$1@news.povray.org...
> > I did a little experiment just now, and I succeded in typing "sphere "
(with
> > trailing space) 19 times in 30 seconds, and that was WITH correcting
several
> > mistakes.
>
> I did 30 "sphere"s/30secs after a few practice runs. So, what is the
> POV-Ray community unofficial record? Only correctly typed words count.
>
> I also think that there is little to gain by using aliasing. Also, how
> many people knows how to use TAB (at least in windows version) to use
> autocomplete feature? It also speeds up writing.
>
> Severi


Post a reply to this message

From: Groucho
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 10:35:24
Message: <4120c62c$1@news.povray.org>
I agree that what a language needs is legibility. From my point of view, C++
lost that long time ago ... but this is a different history.

Talking about legibility, I would like to know why the directives sitll need
the simbol #. I know that they are interpreted during parsing time and so on
but I think that many of our scenes have more lines beginning with # than
the opposite. Belive me, with some keyboards, it is a difficult symbol.

Why not writing:
declare i=0;
while (i<10)
    sphere {(0,0,i) i/2}
    i=i+1;
end

There should be many problems for the interpreter?

Thx,
Groucho

"Doppelganger" <ped### [at] netcabopt> wrote in message
news:411ed9f8$1@news.povray.org...
> >More comfortable work = more time to concentrate on picture itself.
>
> this is only true for short term work. though I'm not a POV-Ray expert, my
> experience with other languages in which shorthand syntax exists makes me
> say that it's only "comfortable work" for 2 or 3 lines worth of code in
> every 500. The code with dense shorthand easily becomes cluttered and
> impossible to read.
>
> Giving an example of how bad short hand can be in Mathematica code (and I
> tried using this sort of code for serious programming -- to give up
> reasonably soon afterwards):
>
> Compare:
>
> f[x_]=x^2;
> list=Map[f,{1,2,3,4}];
> Apply[Plus,list];
> list
>
> With:
>
> Plus@@((#^2)&/@{1,2,3,4})
>
> they both get the list {1, 2, 3, 4}, square all entries, and sum all the
> entries. Which code segment do you think you'd understand for what it is 2
> months after you'd written it? I had to rtfm to get the second one right
to
> make this point (though I wrote fluently like it when I used it), whereas
> the first one came naturally.
>
> > > Because it is a bloat-feature based in a bloat mentality
> >
> > ?
>
> it's a non-feature. It's not necessary, hardly useful, and it makes (as
> illustrated) for more hard than good.
>
>


Post a reply to this message

From: Ross
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 10:36:43
Message: <4120c67b$1@news.povray.org>
"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote in message
news:Xns954536876C74raf256com@203.29.75.35...
> chr### [at] gmxde news:cfjc1l$vh2$1@chho.imagico.de
>
> > other keyword with the shortest unique abbreviation - but no one could
> > read the code any more then.
>
> 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
>
> light { y*10 rgb 1 }
> diff {
>   box { -5, +5 }
>   sphere { 0 10 }
>   text {
>   pig { bozo cmap{0:<1,0,0> .5:<1,1,0> 1:1} }
>   norm{ bozo .5 }
>   fin { refl .5 phong 0.5,70 spec 0.1,0.06 }
> }
>
> ?
>
> Aliasing keyword is probably easy, another format of for example color_map
> perhaps not so much.
>
> Just an idea.
>

How about using a text editor that supports word completion. something like
what the tab key does in bash or a myriad of other programs. It' smuch
simpler and doesn't subject other people to your whims of what a language
should be.

-r


Post a reply to this message

From: Ross
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 10:47:13
Message: <4120c8f1$1@news.povray.org>
"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote in message
news:Xns9545EDC67E010raf256com@203.29.75.35...
> spa### [at] raf256com news:Xns9545ED4602E3Craf256com@203.29.75.35
>
> (...)
>
> but anyway I do not insist so hard about aliases, since Tab future is
> greate, if only it would be implemented also in linux-editors...
>
> -- 
> http://www.raf256.com/3d/
> Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
> Computer Graphics

emacs has symbol completion. one just needs to tell it what the symbols are
for the major mode you are in. i havn't even noticed if it works by default
in povmode for emacs. povmode definately has all the keywords needed,
because it performs syntax highlighting properly.


Post a reply to this message

From: Ross
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 11:00:53
Message: <4120cc25@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote in message
news:411### [at] hotmailcom...
> Perhaps those working on other operating systems can push to
> have this functionality placed into their editor?
>
> -Sam
>

Vim and Emacs have the ability to have this functionality in general. What
other editors are there? ;)

What about the new qtpoveditor? does it have symbol completion?


Post a reply to this message

From: Brian Elliott
Subject: Re: How about $ for declare?
Date: 17 Aug 2004 08:07:09
Message: <4121f4ed$1@news.povray.org>
"Ross" <rli### [at] everestkcnet> wrote in message
news:4120cc25@news.povray.org...
> "Samuel Benge" <stb### [at] hotmailcom> wrote in message
> news:411### [at] hotmailcom...
> > Perhaps those working on other operating systems can push to
> > have this functionality placed into their editor?
> >
> > -Sam
> >
>
> Vim and Emacs have the ability to have this functionality in general. What
> other editors are there? ;)
>
> What about the new qtpoveditor? does it have symbol completion?

According to Florian, yes it does also!

Cheers,
    Brian


Post a reply to this message

From: selsek
Subject: Re: How about $ for declare?
Date: 20 Aug 2004 20:15:01
Message: <web.41269325ccee1183502b4aff0@news.povray.org>
Some suggestions:

-file starts with a #development [code]
-the [code] is in an ini file in pov-ray's directory, along with custom code
prefs (sphere=sp,...) (you may have several [codes])
-> on the computer with the [code], you'd see sp{0,1}, but on a computer
without the proper [code], or without the #development state, or in a text
editor, you'd see standard code.
So the translation would be done in pov.

A better interface!
1- customisable button bar (you would add links to files from insert menu:
add something in one click)
2- at least, a return on screen option (or have i missed it?)
3- an enhanced insert menu interface to the left of the screen (i wonder if
many on us use that part of the screen)
-see the right menu in 3ds/gmax/hamapatch? Like that, but to expand the
menus, you may use shortcut keys.

Example:
(initial menu, A,B=things like "light", "shape":)
[A - alt+a]
[B - alt+b]

(do alt+a:)
[A - alt+a]
  [sphere - ctrl+shift+s]
  [cylinder - ...]
[B - alt+b]

So if you can customise the shortcuts, the text editing will be MUCH faster,
and not so hard to use since you don't have to remember the shortcut keys.
Faster? you won't use the mouse anymore, won't have to use the arrows to
navigate in the insert menu

selsek


Post a reply to this message

From: Alain
Subject: Re: How about $ for declare?
Date: 20 Aug 2004 21:52:50
Message: <4126aaf2$1@news.povray.org>
selsek nous apporta ses lumieres ainsi en ce 20/08/2004 20:11... :

>Some suggestions:
>
>-file starts with a #development [code]
>-the [code] is in an ini file in pov-ray's directory, along with custom code
>prefs (sphere=sp,...) (you may have several [codes])
>-> on the computer with the [code], you'd see sp{0,1}, but on a computer
>without the proper [code], or without the #development state, or in a text
>editor, you'd see standard code.
>So the translation would be done in pov.
>
>A better interface!
>1- customisable button bar (you would add links to files from insert menu:
>add something in one click)
>2- at least, a return on screen option (or have i missed it?)
>3- an enhanced insert menu interface to the left of the screen (i wonder if
>many on us use that part of the screen)
>-see the right menu in 3ds/gmax/hamapatch? Like that, but to expand the
>menus, you may use shortcut keys.
>
>Example:
>(initial menu, A,B=things like "light", "shape":)
>[A - alt+a]
>[B - alt+b]
>
>(do alt+a:)
>[A - alt+a]
>  [sphere - ctrl+shift+s]
>  [cylinder - ...]
>[B - alt+b]
>
>So if you can customise the shortcuts, the text editing will be MUCH faster,
>and not so hard to use since you don't have to remember the shortcut keys.
>Faster? you won't use the mouse anymore, won't have to use the arrows to
>navigate in the insert menu
>
>selsek
>
>
>  
>
OK. You propose a _display_ user defined substitution of selected 
keywords. That way, you can use whatever personal shorthand you want, 
while still outputing normal code. The support for that will make the 
editor biger and more prone to bugs. Maybe somebody can make a patched 
version to test it...

Alain


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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