[SOLVED] Gambas Style Guide

Post

Posted
Rating:
#1 (In Topic #699)
Avatar
Trainee
Hi, everyone!

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></LIST>
<LIST></LIST>
Any additional information would be appreciated!

Thanks in advance!
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
I have seen various opinions on this subject, but there is no law laid down saying you should do it 'this way'.

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!
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
I'd agree, when it comes to style just go with what makes you comfortable.

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 :)
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Trainee
 Hi, guys!
I got it. Thanks for your replies!
Online now: No Back to the top
1 guest and 0 members have just viewed this.