Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.programming Subject: Re: Here is why C++ and C are bad... Date: Wed, 30 Dec 2015 15:48:42 +0000 Organization: A noiseless patient Spider Lines: 31 Message-ID: <87h9j06ip1.fsf@bsb.me.uk> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="30951"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CPZPpe4zAVxlUeoC6cpSUG029360LXPw=" Cancel-Lock: sha1:pT3/FA+Cjv241Om/l4se+QZGDkQ= sha1:xa/fUiQz/YdOmngDEC1C61V3nyU= X-BSB-Auth: 1.ac697cbb640a947324e8.20151230154842GMT.87h9j06ip1.fsf@bsb.me.uk Xref: csiph.com comp.programming:6080 Richard Heathfield writes: > On 30/12/15 08:56, David Brown wrote: >> On 29/12/15 23:19, Richard Heathfield wrote: > > > >>> 2) mixing of signed and unsigned expressions is very often a sign that >>> the program hasn't been thought through properly. This, too, is (I >>> think) a discussion that might also turn out to be profitable, despite >>> its origins. >> >> Perhaps that could usefully be discussed here, since it is an issue that >> can affect many languages. > > Oddly, the signed/unsigned dilemma is one that can bite us even if we > are only dealing exclusively (or so we think) with unsigned > values. Since this is comp.programming, you should perhaps have said that mixing signed and unsigned expressions _in C_ is often a bad sign. It may be in other languages too, but there are others in which it is both common and harmless. The points you go on to make are about problems in the way C defines the behaviour of such mixed-type expressions -- they aren't programming problems per se. -- Ben.