[SOLVED] Gambas Style Guide
Posted
#1
(In Topic #699)
Trainee
I would like to know wether there is a sort of gambas coding style guide?
I only found these resources in the official gambas wiki:
<LIST></LIST>
<LIST>
- <LI>/doc/naming - Gambas Documentation</LI>
<LIST></LIST>
Any additional information would be appreciated!
Thanks in advance!
Posted
Guru

I use small letters in front of variables to donate the type. e.g. iCount for an integer, but I would use this for an array as well. Regrading form components, I can't see the point of changing Button1 to btnClear when all I have to do is change the '1' to 'Clear', so changing Button1 to ButtonClear is less work. Either of these is useful when you are coding in the IDE and you can't remember what you called that button, as soon as you type 'Button' Gambas will give you a list: -
<IMG src="https://www.cogier.com/gambas/Button.png">
</IMG>This discussion could go on forever, so I suggest you pick out what suits you and get on creating that 'must have' application!
Posted
Guru

I started helping with gambas development so that involved learning Benoits style. So my style has adapted somewhat.
Using iVar for Integer sVar for String etc makes sense and makes for more understandable code (6 months later when you've forgotton it) as does nice descriptive variable names.
there is a setting in gambas in your projects properties (options) to check your variable definitions for the i or s or whatever. (check prefix of variables)
but for the most part, if you plan on sharing your code , try to stick with popular styles. if not then do whatever
Posted
Trainee
I got it. Thanks for your replies!
1 guest and 0 members have just viewed this.



