News for hackers. Stuff that matters.
Re:Annoyances of API Design by aji on Thursday January 28, 2016 @02:37PM (#10990607)
'dup' is a bad example from C, in my opinion. ('dup' and 'dupe' are both short forms of 'duplicate' anyway.)

What about 'strncpy' versus 'strlcpy'? Or 'vsnprintf'? 'fcntl.h'? 'execlp'? 'EBADF'? 'SIGSEGV'? 'lstat'?

Re:Annoyances of API Design by Gibbon1 on Thursday January 28, 2016 @08:18PM (#10992830)
Course those come from a primordial age when max symbol sizes and file names were limited. Circa 1975 you were asking for trouble with a file name like string_copy.c or file_control.c
Re:Annoyances of API Design by annnnd on Friday January 29, 2016 @03:31AM (#10994162)
Also, I kind of like the short versions. They are not any more difficult to remember ("Hmm, was it CopyFile of FileCopy?") and you need to search for them the first time around anyway. And it does save the effort when typing.
Re:Annoyances of API Design by ucho on Friday January 29, 2016 @09:42AM (#10995416)
I still don't remember if it is useradd or adduser - one is core linux command, other is script that also set ups home directory and stuff like that.
Re:Annoyances of API Design by timlyo on Friday January 29, 2016 @03:58AM (#10994249)
Maybe it's just me but I find the short ones much harder. Was it strnCopy or strCopy etc.

And I mostly use some form of auto complete so I'm not worried about the effort saved from typing.

Re:Annoyances of API Design by dkersten on Friday January 29, 2016 @07:49AM (#10994890)
Also, if you glance at them, strcpy and strncpy look identical, which I find can be problematic.
Re:Annoyances of API Design by rossy on Thursday January 28, 2016 @06:06PM (#10992229)
Or 'tmpfile' and 'tmpnam'. Gotta save those characters. 'tempfile' and 'tempname' would be to hard to type. (Also, why not 'tmpfil'?)
Re:Annoyances of API Design by to3m on Thursday January 28, 2016 @09:34PM (#10993137)
The number of significant characters in an extern symbol was only upgraded to 31 with C99... prior to that, it was all of 6.
Re:Annoyances of API Design by sgt on Friday January 29, 2016 @07:35AM (#10994843)
This sounded a bit far-fetched so I did some digging. It is true that C89 had a maximum of 6 characters for external identifiers. C89 is often called ANSI C.

C89 says:

"The implementation shall treat at least the first 31 characters of an internal name (a macro name or an identifier that does not have external linkage) as significant. Corresponding lower-case and upper-case letters are different. The implementation may further restrict the significance of an external name (an identifier that has external linkage) to six characters and may ignore distinctions of alphabetical case for such names./10/ These limitations on identifiers are all implementation-defined."

Source: http://flash-gordon.me.uk/ansi.c.txt

Re:Annoyances of API Design by kbutler on Thursday January 28, 2016 @08:17PM (#10992826)
creat