[Uim-bugs] [Bug 1448] New: argument names are ambiguous and inconsistent
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Thu Sep 23 17:35:42 EEST 2004
Please do not reply to this email: if you want to comment on the bug, go to
the URL shown below and enter yourcomments there.
https://freedesktop.org/bugzilla/show_bug.cgi?id=1448
Summary: argument names are ambiguous and inconsistent
Product: UIM
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P4
Component: libuim
AssignedTo: uim-bugs at freedesktop.org
ReportedBy: yamaken at bp.iij4u.or.jp
Some argument names in libuim are ambiguous and inconsistent. It should be
modified to provide obvious meanings.
For example, following function uses 'id_' and 'id' to distinguish types between
LISP and int. But such implicit rule is not familiar for ordinary programmers
although '_name' style variable names are well known as 'private name'.
Requiring such unfamiliar treatment may introduce unwanted human errors.
static LISP
im_shift_page_candidate(LISP id_, LISP dir_)
{
uim_context uc;
int id = get_c_int(id_);
int dir;
if FALSEP(dir_)
dir = 0;
else
dir = 1;
uc = uim_find_context(id);
uim_schedule_cb(uc, CAND_SHIFT_PAGE_CB, NULL, dir, 0);
return false_sym;
}
To avoid such ambiguous meaning, I suggest that explicit type indication such as
'lisp_id' or 'c_id'. I think that using 'LISP id' and 'int c_id' is appropriate
because some other functions does not use C version of arguments.
Currently such argument names are inconsistent as follows.
im_set_encoding(LISP id, LISP enc)
im_update_mode(LISP id, LISP mode_)
im_activate_candidate_selector(LISP id_, LISP nr_, LISP display_limit_)
Some names are arbitrarily lacking trailing '_' and others are not. This result
means that the implicit rule ware not recognized by some developers (including
me). This inconsistent naming rule obscures the implicit meaning and confuses
developers.
Removing '_' from arguments and use 'c_' prefix for C versions of the variables
in the functions will resolve the problem for anyone.
--
Configure bugmail: https://freedesktop.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the uim-bugs
mailing list