[Gambas-user] Values between forms..

Doriano Blengino doriano.blengino at ...1909...
Sat Nov 8 18:26:45 CET 2008


Benoit Minisini ha scritto:
> On samedi 8 novembre 2008, Doriano Blengino wrote:
>   
>> birchy ha scritto:
>>     
>>> Bugzilla from gambas at ...1... wrote:
>>>       
>>>> One of the rules of good programming is making the less possible things
>>>> public
>>>>         
>>> I totally agree with this, but if we have a project rich with progress
>>> bars and other graphical displays, it is not uncommon to write a class or
>>> module to handle them. Perhaps i have misunderstood how to do this in
>>> Gambas. How would i do this from a class without making the controls
>>> public?
>>>       
>> Perhaps a wrapper method should be used... with no gain (one thing
>> public instead of another one - where is the improvement?).
>>     
>
> This is an improvement because you have *only the needed* thing public instead 
> of *everything*.
>
>   
I agree partly with you. But, if you have something 8 values (or more), 
then you write a method with eight parameters. Then, in different 
places, you discover you are not interested in set them all, so you 
start to write different methods with less parameters, and you want to 
group them in a reasonable way - or write 8 single-parameter methods (or 
a method with optional arguments). What a mess... where no lines of code 
could be enough, you start to write several.

Now you are thinking: "So, you did not planned enough, and now you don't 
know where to go". It is right, and all us programmer do so (and you 
too). And sometimes, you start write something, and your customer (or 
yourself) find that things could be better.

To make it short, you are right. But a programming language should 
encourage, not force, good programming techniques. So I would prefer a 
language that lets me choose - the quick and dirty way, or the "long 
term", more reasoned one.

Best regards,
Doriano





More information about the User mailing list