[Gambas-user] Better use of prefixes

Cedron Dawg cedron at exede.net
Sat Mar 16 21:52:48 CET 2019


Roger that.

I don't generally use prefixes on Control Names, that's part of my (none) group.

Didn't you mean?

btnThat_click() 
btnThis_click() 
btnWhatever_click() 

I would use:

ThatButton_Click()
ThisButton_Click()
WhateverButton_Click()

for buttons on the form that say [That][This][Whatever]

It's more linguistically (at least English style) consistent with natural language.

Your sort order argument is valid though, but often enough don't you have a group of controls for a single purpose?  So you might have

NameEntryTextBox
NameEntryButton
NameEntryStyleComboBox

I am working on fairly large application now.  I am naming all the subroutines and controls with handlers a prefix for the tab they are on.  That way all the routines group in the code routine list drop down.

Again, the prefix has a where function to it.  Same style as I use for enumerated constants "XX_".


----- Original Message -----
From: "gen braga" <genbraga1 at gmail.com>
To: "user" <user at lists.gambas-basic.org>
Sent: Saturday, March 16, 2019 4:00:42 PM
Subject: Re: [Gambas-user] Better use of prefixes

Cedron, 

I didnt mean a group handler... I mean all buttons grouped sequentialy in the IDE code editor's method selector combo box: 

btnButtonThat_click() 
btnButtonThis_click() 
btnButtonWhatever_click() 

Any reasonably intelligent person would need a minimun knowledge of Gambas or VB to understand group handlers anyway. Past the needed knowledge to understand prefixes. 

Cheers, 

Gen. 



More information about the User mailing list