Bug 71810 - UI: BITAND function arguments have same name.
Summary: UI: BITAND function arguments have same name.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.3.2 release
Hardware: Other All
: medium normal
Assignee: Winfried Donkers
URL:
Whiteboard: BSA Confirmed:4.2.0.1:Ubuntu target:4...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-19 20:39 UTC by John Smith
Modified: 2014-04-30 10:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of Function Wizard showing function arguments. (2.91 KB, image/png)
2013-11-19 20:39 UTC, John Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Smith 2013-11-19 20:39:23 UTC
Created attachment 89488 [details]
Screenshot of Function Wizard showing function arguments.

Problem description: 
The two arguments of the function have the same name.

Expected behavior:
Arguments should have different names (same point as bug 71128 has raised).
              
Operating System: Windows XP
Version: 4.1.3.2 release
Comment 1 John Smith 2013-11-19 20:50:13 UTC
Functions BITOR and BITXOR also have the same names for both their arguments.
Comment 2 Robinson Tryon (qubit) 2013-12-22 15:52:47 UTC
CONFIRMED on Ubuntu 12.04.3 with
LibreOffice Version: 4.2.0.1

(In reply to comment #0)
> Problem description: 
> The two arguments of the function have the same name.
> 
> Expected behavior:
> Arguments should have different names (same point as bug 71128 has raised).

(In reply to comment #1)
> Functions BITOR and BITXOR also have the same names for both their arguments.

CC'ing Winifred Donkers

Platform: All
Status: NEW
Comment 3 Winfried Donkers 2013-12-23 08:33:56 UTC
Calc functions BITAND, BITOR and BITXOR all have 2 arguments, both with the name 'number'.
The order of the two is of no consequence for the result of the functions (which is not the case with MMULT in bug 71128), so there is no need to give them separate names.
One could even argue that giving the 2 arguments different names suggests that they are not interchangeable.

IMHO giving the 2 arguments different names is a matter of user interface policy.
I cc the ux-advise list to hear what they think should be changed or maintained.
Comment 4 Robinson Tryon (qubit) 2013-12-24 00:18:30 UTC
(In reply to comment #3)
> Calc functions BITAND, BITOR and BITXOR all have 2 arguments, both with the
> name 'number'.

I'd say they might both have *type* number, but I wouldn't use the same identifier 'number' for both of them.

> The order of the two is of no consequence for the result of the functions
> (which is not the case with MMULT in bug 71128), so there is no need to give
> them separate names.

Generally speaking, I'd suggest that each argument to a function be uniquely named, even if only number_1, number_2, ..., number_i.

> One could even argue that giving the 2 arguments different names suggests
> that they are not interchangeable.

If two or more arguments to a given function are given precisely the same name, I might get the impression that they had to be the same value. I can't think of a single programming language in which I can refer to the first or nth argument to a function using interchangeable identifiers. 

Example of ambiguity:

SUM(number, number) {
  return number + number;  // ???
}

> IMHO giving the 2 arguments different names is a matter of user interface
> policy.
> I cc the ux-advise list to hear what they think should be changed or
> maintained.

+1, I'd appreciate their input as well :-)
Comment 5 Robinson Tryon (qubit) 2013-12-24 00:25:53 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Calc functions BITAND, BITOR and BITXOR all have 2 arguments, both with the
> > name 'number'.

Gnumeric (1.10.17) has:

  BITAND(a, b)

Excel docs on BITAND()[1] use the following notation:

  BITAND( number1, number2)



[1] https://office.microsoft.com/en-us/excel-help/bitand-function-HA102753251.aspx
Comment 6 Winfried Donkers 2013-12-24 09:37:16 UTC
(In reply to comment #4)

Your arguments are clear and quite convincing to me.
But since I'm a much more a developer than a ux-expert, I will await some more ux arguments/preferences before patching this.
The patch is very simple ( using number_1, number_2 is consistent with other calc functions) and there is ample time before version 4.3.
(I don't think this is a bug of the kind that needs to be fixed in current versions 4.1, 4.2)
Comment 7 Winfried Donkers 2014-01-13 14:56:23 UTC
Submitted a patch with Number1, Number2.
Don't like open bug reports ;)
Comment 8 Commit Notification 2014-01-30 13:03:50 UTC
Winfried Donkers committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a750bb73502cc74980d1bd4e3cbabf6214c65c0d

fdo#71810 make argument names consistent with Gnumeric and Excel



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.