Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: standard error codes Date: Fri, 13 Jan 2017 09:27:47 -0800 Organization: None to speak of Lines: 29 Message-ID: References: <96e16709-18eb-4399-86c4-a6f30a767df3@googlegroups.com> <87o9zdtgzo.fsf@gmail.com> <3gulkd-1ds.ln1@wilbur.25thandClement.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="5af804fde095f0102ceb1f5e23093854"; logging-data="28735"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AWEhcpV6k2WfeR1KO6BOO" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:HO25AW0gMLEw1OXSV9VD83tJ/U0= sha1:2vqUYVNgW0ZVsFaA9U05KWp1ieo= Xref: csiph.com comp.lang.c:101621 writes: > Keith Thompson wrote: [...] >> It's nice for a function that returns a result to have a name >> that relfects the meaning of that result, but it's not always >> practical. And in the case of strcmp, you can think of the >> negative/zero/positive result it returns as a *comparison*, which >> makes the name strcmp, perfectly sensible. It's not the most >> intuitive name, but it's more than good enough. > > What would be more intuitive? (Maybe you're just being polite?) I was comparing the name strcmp to other names for other functions, not necessarily to alternative names for strcmp itself. For example, the time() function has a nicely intuitive name that describes the meaning of the value it returns. Given what strcmp() does, the name "strcmp" is probably about as good as anything I could think of. (Some might complain about the terseness, compressing "string" to "str" and "compare" to "cmp", but that's another matter.) [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"