[V4REV] symbolic constants

Ruslan Zasukhin sunshine at public.kherson.ua
Fri May 13 08:59:59 CDT 2005


On 5/13/05 2:52 AM, "Robert Brenstein" <rjb at robelko.com> wrote:

> b) declaring a globals by us is not a problem per se. However, if I
> have to declare over and over a series of constants with names like
> EVDebugLevel_kLogParams, it will be more effort than it is worth it.

> Lots of typing with plenty of chances for typos whereas typing a
> constant will be always simpler and less error prone.

Wait, but what alternatives are ?!!!
look

1) you can just write
        get Valentina( "DebugLevel", 3 )

        VDatabase_SqlSelect( query, 1, 2, 2 )

        -- do you remember what means 1, 2, 2 ?!
           I never remember this
           when I get project for test I always must go to docs to see
           what his means and may be here wrong values?

2) so if you agree that numeric values are devil, then you will start SELF
define symbolic variable in the same way in EACH function where you need it

 on event       
      kClientSide = 1
      kReadOnly = 2
      kRandom  = 2

      VDatabase_SqlSelect( query, kClientSide, kReadOnly, kRandom )
 end   

But how this differ from

 on event       
      global kClientSide, kReadOnly, kRandom

      VDatabase_SqlSelect( query, kClientSide, kReadOnly, kRandom )
 end   


I think that first way even worse, because you AGAIN must remember actual
numeric values. 

Actually Transcript itself is very weak here. No constants...

3) btw, way with globals have trap that if you use global var, but forget
declare it inside of function as global you get zero value.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list