Jump to content



Photo

GUI Function Names


  • Please log in to reply
38 replies to this topic

#1 Jon

Jon

    Up all night to get lucky

  • Administrators
  • 9,529 posts

Posted 28 November 2004 - 03:15 PM

Ok, pretty happy with the GUI now, I just want to make sure we are all happy about the function names as once I do a "public" release I'll be reluctant to change them.

The list of GUI functions is:
GUICreate
GUICtrlCreateAvi
GUICtrlCreateButton
GUICtrlCreateCheckbox
GUICtrlCreateCombo
GUICtrlCreateContextMenu
GUICtrlCreateDate
GUICtrlCreateDummy
GUICtrlCreateEdit
GUICtrlCreateGroup
GUICtrlCreateIcon
GUICtrlCreateInput
GUICtrlCreateLabel
GUICtrlCreateList
GUICtrlCreateMenu
GUICtrlCreateMenuitem
GUICtrlCreatePic
GUICtrlCreateProgress
GUICtrlCreateRadio
GUICtrlCreateSlider
GUICtrlCreateTab
GUICtrlCreateTabItem
GUICtrlCreateTreeView
GUICtrlCreateTreeViewitem
GUICtrlCreateUpdown
GUICtrlDelete
GUICtrlGetState
GUICtrlSetBkColor
GUICtrlSetColor
GUICtrlSetCursor
GUICtrlSetData
GUICtrlSetFont
GUICtrlSetImage
GUICtrlSetLimit
GUICtrlSetOnEvent
GUICtrlSetPos
GUICtrlSetResizing
GUICtrlSetState
GUICtrlSetStyle
GUICtrlSetTip
GUIDelete
GUIGetCursorInfo
GUIGetMsg
GUIRead
GUIRecvMsg
GUISendMsg
GUISendToDummy
GUISetBkColor
GUISetCoord
GUISetCursor
GUISetFont
GUISetHelp
GUISetIcon
GUISetOnEvent
GUISetState
GUIStartGroup
GUISwitch

That's fine, but I think some are wrong, these:
GUIRead
GUIRecvMsg
GUISendMsg

They refer to controls so maybe they should have GuiCtrl... prefixed.

Also, I mostly like the naming conventions (fits in with the descriptive, if long, style of AutoIt functions), but a couple of the GUI functions end up being massive, like:
GUICtrlCreateContextMenu

Should we try and shorten them (all of them, not just the contextmenu one)? Or is the long but descriptive version better? What about Add instead of Create to at least save 3 letters :)
GUICtrlAdd...?
GCtrlAdd...?
GCAdd...?
etc...

Or CMenu for ContextMenu? TV or TView for TreeView?







#2 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 28 November 2004 - 03:39 PM

I agree with Larry.

#3 Jos

Jos

    oh joy ...

  • Developers
  • 21,061 posts

Posted 28 November 2004 - 04:06 PM

I like the long names as well for readability...

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#4 Jon

Jon

    Up all night to get lucky

  • Administrators
  • 9,529 posts

Posted 28 November 2004 - 04:14 PM

Ok, that's a pretty good indication.

What about the other point:
GUIRead
GUIRecvMsg
GUISendMsg

Should I rename them to:
GuiCtrlRead
GuiCtrlRecvMsg
GuiCtrlSendMsg
?

#5 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 8,925 posts

Posted 28 November 2004 - 04:14 PM

I am a 2 finger typer so I like short function names

So to shorten we can have at least the ContextMenu and TreeView shorten.

for the GuiCtrl... GUISendToDummy is missing in the list of functions to be renamed.

#6 alawoona

alawoona

    Adventurer

  • Active Members
  • PipPip
  • 132 posts

Posted 28 November 2004 - 04:26 PM

my preference is for the long names, but not wedded to that. just consistency - if long, all long, if short, all short

#7 Jos

Jos

    oh joy ...

  • Developers
  • 21,061 posts

Posted 28 November 2004 - 05:09 PM

Ok, that's a pretty good indication.

What about the other point:
GUIRead
GUIRecvMsg
GUISendMsg

Should I rename them to:
GuiCtrlRead
GuiCtrlRecvMsg
GuiCtrlSendMsg
?

<{POST_SNAPBACK}>

The proposed names are better for consistency ..

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#8 MHz

MHz

    Just simple

  • MVPs
  • 5,400 posts

Posted 28 November 2004 - 05:21 PM

GUICtrlCreateProgress
I think Create could be shortened to
GuiCtrlCrProgress
that would save 4 letters.
I consider all the common wording in the functions could be shortened.
Or CMenu for ContextMenu? TV or TView for TreeView?
I do not like TV. Not descriptive. TView sounds good. Plus CMenu also. Maybe Checkbox could be Chkbox?
GuiCtrlRead GuiCtrlRecvMsg GuiCtrlSendMsg
May as well change these 3. Have not worked out how to use the last 2 yet. But use GuiRead alot for reading checkboxes and inputboxes.

#9 MHz

MHz

    Just simple

  • MVPs
  • 5,400 posts

Posted 28 November 2004 - 06:32 PM

This is a perhaps a radical change? But currently you have to enter lots of common characters before you reach the actual control names.
GUICtrlSet     10 Letters GUICtrlCreate  13 Letters

A reduction could be done by having Ctrl on the tail end instead.
Plain Text         
GUICreate GUICrAviCtrl GUICrButtonCtrl GUICrChkboxCtrl GUICrComboCtrl GUICrCMenuCtrl GUICrDateCtrl GUICrDummyCtrl GUICrEditCtrl GUICrGroupCtrl GUICrIconCtrl GUICrInputCtrl GUICrLabelCtrl GUICrListCtrl GUICrMenuCtrl GUICrMenuitemCtrl GUICrPicCtrl GUICrProgressCtrl GUICrRadioCtrl GUICrSliderCtrl GUICrTabCtrl GUICrTabItemCtrl GUICrTrViewCtrl GUICrTrViewitemCtrl GUICrUpdownCtrl GUIDeleteCtrl GUIGetStateCtrl GUISetBkColorCtrl GUISetColorCtrl GUISetCursorCtrl GUISetDataCtrl GUISetFontCtrl GUISetImageCtrl GUISetLimitCtrl GUISetOnEventCtrl GUISetPosCtrl GUISetResizingCtrl GUISetStateCtrl GUISetStyleCtrl GUISetTipCtrl GUIDelete GUIGetCursorInfo GUIGetMsg GUIReadCtrl GUIRecvMsgCtrl GUISendMsgCtrl GUISendToDummy GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUIStartGroup GUISwitch


#10 this-is-me

this-is-me

    Pursuer of obscure functionality

  • Active Members
  • PipPipPipPipPipPip
  • 2,372 posts

Posted 28 November 2004 - 07:20 PM

Personally, I use scite for autocomplete of all function names, and it is kinda hard typing GuiCtrlCreate before even typing the first letter of the item I want to create. What about just CtrlAdd? Something like CtrlAddButton? I would personally prefer Some stat letters at the beginning of all control functions, but a small amount of them. Readability is one of the most important points, so MHZ's idea will definately not work.


What about the following:

Plain Text         
CtrlAddAvi CtrlAddButton CtrlAddCheckbox CtrlAddCombo CtrlAddContextMenu CtrlAddDate CtrlAddDummy CtrlAddEdit CtrlAddGroup CtrlAddIcon CtrlAddInput CtrlAddLabel CtrlAddList CtrlAddMenu CtrlAddMenuitem CtrlAddPic CtrlAddProgress CtrlAddRadio CtrlAddSlider CtrlAddTab CtrlAddTabItem CtrlAddTreeView CtrlAddTreeViewitem CtrlAddUpdown


of corse, the functions no longer have the GUI in front of them, but is that needed?
Who else would I be?

#11 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 28 November 2004 - 07:27 PM

Why not replace "Ctrl" with "Gui" in this-is-me's idea?:

GuiAddAvi
GuiAddButton
GuiAddCheckbox
GuiAddCombo
GuiAddContextMenu
.....
GuiAddTab
GuiAddTabItem
GuiAddTreeView
GuiAddTreeViewitem
GuiAddUpdown

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

#12 SlimShady

SlimShady

    AutoIt lover

  • Active Members
  • PipPipPipPipPipPip
  • 2,383 posts

Posted 28 November 2004 - 07:32 PM

Why not replace "Ctrl" with "Gui" in this-is-me's idea?:

GuiAddAvi
GuiAddButton
GuiAddCheckbox
GuiAddCombo
GuiAddContextMenu
.....
GuiAddTab
GuiAddTabItem
GuiAddTreeView
GuiAddTreeViewitem
GuiAddUpdown

<{POST_SNAPBACK}>

I agree.

#13 this-is-me

this-is-me

    Pursuer of obscure functionality

  • Active Members
  • PipPipPipPipPipPip
  • 2,372 posts

Posted 28 November 2004 - 08:06 PM

Sounds good to me.
Who else would I be?

#14 w_sp8er

w_sp8er

    Wayfarer

  • Active Members
  • Pip
  • 57 posts

Posted 28 November 2004 - 10:38 PM

Bedtime stories are good!

I agree with Larry, the LongCommandNames instead of the ShCoNames are MUCH easier to read (& I would find it much easier to debug).

But then again, that's just my opinion! :)

#15 MHz

MHz

    Just simple

  • MVPs
  • 5,400 posts

Posted 29 November 2004 - 05:32 AM

I kicked off an new radical idea? I thought I would get super strong opposition from this.
Anyway, I like the look of CS function names. Any function names whether 10 characters long or 26 characters long, takes time to get used to recognizing them and understanding what they are. But the big benefit is writing the code with efficient naming syntax. Recognition of interpreting the code, comes with time and experience. Recognition is easier with smaller words with less letters.
My variables are $chk for checkbox, $lbl for label and so on. Learned from doing Visual basic. I have no problem at all, reading these variable methods. Same can be for functions. CS method is not as extreme. Still looks basic. Saves typing 10 or so letters before you reach, the range of controls that you are interested in.

@w_sp8er
Do you live just around the corner from me? I'm at Strathpine. :)

#16 john925

john925

    Wayfarer

  • Active Members
  • Pip
  • 53 posts

Posted 29 November 2004 - 06:30 AM

I like CyberSlug's method. It's much shorter than the current names but still completely understandable.

#17 Holger

Holger

    AutoIt Spammer

  • Developers
  • 1,384 posts

Posted 29 November 2004 - 09:53 AM

I like the idea of having
GuiAddButton instead of
GuiCtrlCreateButton :)
So I can use similar function names for the tray stuff (TrayAddMenu,etc).
So long :)
Holger

#18 CyberSlug

CyberSlug

    Overwhelmed with work....

  • MVPs
  • 3,587 posts

Posted 29 November 2004 - 01:22 PM

If we changed the naming, what should we do to the following function names?

GuiCtrlSetState --> GuiSetCtrlState? or unchanged?
GuiCtrlDelete --> GuiRemoveCtrl??

GuiDelete --> GuiDestroy? or unchanged?
GuiSetState

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

#19 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 29 November 2004 - 02:01 PM

You want long names? Use any .NET language. These names aren't long, these are fine, leave most of them alone and make the few minor changes with things like GuiRead() and GuiSend/RecvMsg(). Those have been discussed before. Nobody had been complaining about "long" function names until now. In fact, the only complaint was that a few of us did mention that some of the names didn't fit in so well (Which I mentioned a couple sentences back). The current names are not ambiguous in the least. Its better to be explicit than ambiguous, that leads to far less confusion.

#20 MHz

MHz

    Just simple

  • MVPs
  • 5,400 posts

Posted 29 November 2004 - 02:46 PM

GUICtrlAdd...?
GCtrlAdd...?
GCAdd...?
etc...

Sorry, but it was asked in the first post. This is a recent event of changing names. I know of no previous discussion on this. No-one even knew what the final functions would be. Dot notation used in .Net is different to function names in Autoit3. Like comparing oranges to apples. Shortened names would still be explicit?
This will set the standard for Autoit 1.0.103 Final and set the base for Autoit 1.0.104. So the decision should be made suitable. No matter what the outcome would be.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users