[V4REV] Advice 2 about func names

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


>  > 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.
>
>How this can raise name conflicts ???
>All our funcs will start with V and have db specific words
>     database, table, field, ...

Valentina has quite a few functions and with a single-letter prefix, 
there is more potential for conflict than with a longer prefix. Even 
if only optically (I mean misreading). Many people startying with Val 
may be converting some old programs using other db or stack-based 
storage and you never know what names they are using. It must not be 
but there is potential.

Personally, I would prefer val instead of just V as prefix. Like all 
IDE calls are prefixed with rev or revDB calls are prefixed with 
revdb_.

'val' is more mnemonic and easier to pronounce.

I know that with your C/RB background, you have tendency to create 
short names, but longer names is quite common in Transcript. Call it 
verbose or call it self-documenting. For example

revSetDatabaseDriverPath

>  > 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, to use new style, we have NO efforts.
>We remove then some overhead code of 1.x which was here to make it
>compatiable to xCards.
>
>New functions also will make it faster, because now I remove own layer of
>mapping of function names.

But if we want wrappers in our programs, we have to do it in our code 
then, and transcript is slower than C in that respect. So give some, 
take some.

>I should not do nothing special. This is supported by Revolution SDK.
>I wonder why before I was pointed into single name direction...
>May be xCards cannot do this in other way ...

Gee, I must catch up on the Rev SDK then. I am particularly curious 
how that works under OS9.

Until recently the SDK was quite badly documented and truly 
Transcript is so rich I have no need to write externals anymore. 
HyperCard's xcmd's and xfcn's could have only a single entry point 
AFAIK. Trevor is up to date with the SDK, so I trust what he says 
about it.

Robert


More information about the Valentina mailing list