Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Improving the program, issues with logical operators, incorrect output Date: Wed, 09 Sep 2015 17:38:25 -0700 Organization: None to speak of Lines: 42 Message-ID: References: <49a5f4a4-8d02-4a48-a338-33a7ebaed71b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="21746"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fN2VORs7yMsakUfj5oWoV" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:TadtWp74jwUy2qBvKr1MBMAh9JA= sha1:iF7uDrsOdLEkdYCrMNss/VrgM0A= Xref: csiph.com comp.lang.c:70103 Malcolm McLean writes: > On Wednesday, September 9, 2015 at 9:34:48 PM UTC+1, Keith Thompson wrote: >> Malcolm McLean writes: >> > As far as a I can ascertain, that style {one true] was used in >> > printed books to save vertical space. Printing is a different >> > technology to screen scrolling, and paper costs money. >> >> Do you have any evidence that that was the actual reason? I use the >> 1TBS myself, and saving vertical space is not my motivation. >> > I've heard that that was the case. I can't remember where, and it's > not the sort of thing that's easy to prove unless there's a written > statement by K and R to that effect. > If you've ever published a book containing computer code, you > understand these issues and it makes perfect sense. It would also make perfect sense if Kernighan and Ritchie happened to use the 1TBS because they preferred it, and used it in their book for that reason. One B manual, , uses the 1TBS ("{" and the end of a line, "}" aligned under the keyword). Another B manual, , uses a variant in which the closing "}" is indented: min(a,b) { if( a doesn't have enough examples to show a consistent style. -- 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"