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: absence of max Date: Mon, 28 Nov 2016 10:10:44 -0800 Organization: None to speak of Lines: 33 Message-ID: References: <0e1db67d-0ab8-4971-a319-8aa66a40b873@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="ee6171370359d1a1a57309acb9d71289"; logging-data="9755"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MsK9+oWEFaT/IeOvC3/jE" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:ssVqxutqJbZjVkSKrs/OdEOC4Po= sha1:NNgb6KD+TB75GiDTlfqxi6C7rro= Xref: csiph.com comp.lang.c:97663 BartC writes: > On 27/11/2016 16:35, David Brown wrote: >> On 27/11/16 01:21, BartC wrote: > >>> So 14 functions so far, and you haven't yet looked at in-place versions. >> >> And that is why there is no "max" standard function in C. > > Huh? That is the very reason why it ought to be built-in and benefiting > from overloading. [...] > Your reasons are just the usual excuses that try and justify why some > obvious feature isn't in C. Of course if it /was/ in, then it would be > indispensable! Ultimately, the set of features that are built into C is pretty much arbitrary. Built-in min and max operators might have been nice to have, but they just don't happen to have been in the original language -- and the functionality can always be implemented in code, though a bit less conveniently than using a built-in operator. If Ritchie had decided to implement min and max operators, I don't believe I'd be saying that they're indepensible. I'd probably say that they can be useful, but they're never strictly necessary, and the language could have gotten along without them. [...] -- 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"