InputBox parameter order

Discuss the future of the AutoHotkey language

Which parameter order for InputBox is preferable?

Text, Default, Title, Options
2
100%
Text, Title, Options, Default
0
No votes
 
Total votes: 2
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

InputBox parameter order

11 Nov 2017, 19:23

- InputBox matters, it's a very commonly used function.
- Parameter order matters, especially for a commonly used function.
- I use the Text parameter 100% of the time.
- I use the Default parameter around 80% of the time.
- I use the Title and/or Options parameter around 5% of the time.
- Therefore in my opinion, Default, should be the 2nd parameter, not the 4th parameter.
- Indeed, when I wrote my own custom InputBox function, it was the obvious choice.
- That's good data, but is based on a one-person data set, so I'm writing to consult other people.

Raw data:

Code: Select all

Text, Default, (Window) Title, Options

474 InputBoxes:
100	T
351	TD
3	TDWO
6	T__O
14	TD_O

contained Text: 474/474 = 100%
contained Default: 368/474 = 77.6%
contained Options: 23/474 = 4.9%
contained Title: 3/474 = 0.6%

Code: Select all

;parameter orders at present:
MsgBox(Text, Title, Options)
InputBox(Text, Title, Options, Default)

;proposed InputBox parameter order:
InputBox(Text, Default, Title, Options)

;two alternative orders, not mentioned in the poll:
MsgBox(Text, Options, Title)
InputBox(Text, Default, Options, Title)
I can live with my custom InputBox function if need be. Thanks for reading.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: InputBox parameter order

12 Nov 2017, 03:34

I don't use InputBox lot
Recommends AHK Studio
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: InputBox parameter order

12 Nov 2017, 04:27

- InputBox matters, it's a very commonly used function.
Maybe it does, but it is? :think:
just me
Posts: 9449
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: InputBox parameter order

12 Nov 2017, 05:27

You're rather late, again. The discussion about parameter order was started on 2016-10-15. The changes have been implemented with v2.0-a078-e25d96b.
lexikos wrote:InputBox and TrayTip would have consistent parameter ordering: ...
I appreciate the current order. But I don't see any reason to vote.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: InputBox parameter order

25 Mar 2018, 17:55

The current order actually has a potentially useful advantage over my proposal.

Code: Select all

InputBox(Text, Title, Options, Default) ;current
InputBox(Text, Default, Title, Options) ;proposed
Most of the time, I omit the Title and Options parameters, giving:

Code: Select all

InputBox(Text,,, Default) ;current
InputBox(Text, Default) ;proposed
The current order has the advantage that when I use only 2 parameters in this way, I can see immediately that the final parameter must be the Default parameter, because there are 3 consecutive commas before it. Otherwise I have to read through the Text parameter, which might be long, to confirm it's only one parameter, and not many parameters.

So, I'm able to withdraw my proposal.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: OpalMonkey and 22 guests