V4RB2, CHG, ValentinaInit()
Ruslan Zasukhin
sunshine at public.kherson.ua
Sun May 2 21:03:42 CDT 2004
On 3/1/04 10:03 PM, "Charles Yeomans" <yeomans at desuetude.com> wrote:
Hi Charles,
So you prefer,
ValentinaInit( s )
real_size = ValentinaCacheSize();
What other people think?
I agree that for GUI tools it is good to have function
ValentinaCacheSize()
>>>> ValentinaIit() now returns the actual size of cache that Valentina have
>>>> allocate.
>>>>
>>>>
>>>> NOTE: for modern OS that have virtual file system, even if you ask 100MB
>>>> for cache, OS can satisfy your request. But Valentina self can decide that
>>>> you ask too big cache size and allocate smaller cache.
>>>>
>>>> In case of any problems, ValentinaInit() will return ZERO.
>>>>
>>>
>>> Again, why return this value? This is old C-style design. Instead,
>>> why not have a separate function ValentinaCacheSize() as Integer?
>>
>> 1) ValentinaInit() can fail.
>
> This is what exceptions are for.
>>
>> if return nothing, then you need ask ValentinaError
>> and we need add one more error code.
>>
>> 2) it can allocate less than you ask.
>>
>> one more function...
>>
>>
>> One return value solve 2 tasks at once.
>
> And this is what I'm complaining about. I think that it's simpler to
> have two things (functions, properties, etc), each of which solves one
> task.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list