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
Functions BITOR and BITXOR also have the same names for both their arguments.
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
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.
(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 :-)
(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
(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)
Submitted a patch with Number1, Number2. Don't like open bug reports ;)
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.