[V4REV] Advice 2 about func names

Robert Brenstein rjb at robelko.com
Fri May 13 12:50:45 CDT 2005


>On 5/13/05 5:30 AM, "Trevor DeVore" <lists at mangomultimedia.com> wrote:
>
>>  On May 12, 2005, at 4:23 PM, Robert Brenstein wrote:
>>>  Not to rain on the parade but IMHO this increases chances of name
>>>  conflicts beyond comfortable and makes the code less self-
>>>  documenting. I rather type a few chars more.
>>
>>  It is really only a two character difference between the two
>>  variants.  I was just joking around about having to type less.  I do
>>  like the proposed syntax more than the Valentina("") stuff (just
>>  because it seems "right") but I could see how that could create
>>  problems for someone who has the code sprinkled all over their
>>  projects.  It really isn't a big deal either way for me.
>
>Hmm, I have think that Revolution can easy
>
>     SEARCH and REPLACE something inside of own projects ?
>
>I was going to offer you, to write small utility,
>I think in 10 lines of code,
>Which can open existed REV project and change
>
>     Valentina( "FooName", ... )
>
>To
>     Valentina_FooName( ... )
>
>Simple REGEX search....
>Where you see problems?

Simple within a single object, but you need to traverse all objects 
in a stack, which is a tad less trivial. But then many projects span 
multiple stacks and substacks, so this has to be accomodated as well. 
Such a function might be quite useful for simpler projects. I would 
suggest to provide it as a function taking stack name as a parameter, 
so we need to call it for each stack being converted. This way, there 
is no guessing what should and what should not be converted.

For complex projects, we can just create our own "Valentina" function 
with a switch on FooName to call Valentina_FooName while converting 
the code otherwise. I may be wrong, but switching to V2 may involve a 
tad more than simply swapping Valentina("FooName",...) for 
Valentina_FooName, although this might be the first step. Heck, my 
biggest project is still running in 1.9.6 so it does not even have 
params for locking :(

>Guys, I really want go with new API.
>
>* It make Valentina for Revolution similar to our other procedural syntax
>
>* it make calls faster
>
>* it simplify our own work, because we should not spend time to support own
>table of function calls.

I don't think anyone is really objecting. Sorry if it seems that I 
am. That is not quite correct ;) I am just arguing some 
implementation issues and raising potential pitfalls or alternative 
ways to handle things. Rather safe than sorry later.

Robert


More information about the Valentina mailing list