[V4REV] Advice 2 about func names

Robert Brenstein rjb at robelko.com
Fri May 13 01:23:16 CDT 2005


>Hi Revolution developers,
>
>In VXCMD 1.x we have
>
>     get Valentina( "FuncName", param1, param2, ... )
>
>Now, since we drop xCards support, I see possibility that each function will
>be registered to Revolution. So we can get e.g.
>
>     get Valentina_FuncName( param1, param2, ... )
>    
>For example:
>
>         get Valentina_Init( 8 * 1024 * 1024 )
>         get Valentina_ShutDown()
>
>Instead of
>            
>         get Valentina( "Init", 8 * 1024 * 1024 )
>         get Valentina( "ShutDown" )
>

I am ambivalent about this, personally. On one hand, it will make 
Valentina appear more integrated with Rev and may be a tad less 
typing, but on the other hand, it will reduce flexibility for 
factoring code since these new functions will have to be hard coded. 
In some of my projects I am using adaptor (wrapper) functions, and 
being able to pass Valentina functions as parameters is quite handy.


>----------------
>Also we can have in 2.x not only Valentina prefix but
>
>    put VDatabase_CreateTable( "person" ) into personRef
>
>    put VTable_CreateStringField( personRef, "Name", 50, fIndex + fUnique )
>     into fldRef
>
>
>Instead of
>
>    put Valentina( "VDatabase_CreateTable", "person" ) into personRef
>
>    put Valentina( "VTable_CreateStringField", personRef, "Name", 50,
>         fIndex + fUnique ) into fldRef
>    
>
>Do you like new syntax ?

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.

I sure hope you will let us to continue using 
Valentina("function",...) as it is now even if you go ahead with 
these new calls. Aside the above points, having to recode some of my 
bigger and older projects would be a big job.

I also wonder about increased effort for you to maintain those new 
functions, particularly when adding new functions. Won't you need to 
have a series of externals instead of a single one? Or are you 
planning to have a Valentina library that defines those as passthru 
functions to the external?

Robert Brenstein


More information about the Valentina mailing list