From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/879 Path: news.gmane.org!not-for-mail From: Mike Bell Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: new "sv status" flags and exit-tracking patch, and misc. Date: Fri, 16 Sep 2005 22:17:21 -0700 Message-ID: <20050917051720.GT15017@mikebell.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126934280 822 80.91.229.2 (17 Sep 2005 05:18:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Sep 2005 05:18:00 +0000 (UTC) Cc: supervision@list.skarnet.org Original-X-From: supervision-return-1115-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Sep 17 07:17:52 2005 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1EGV4m-0004Mv-VO for gcsg-supervision@gmane.org; Sat, 17 Sep 2005 07:17:25 +0200 Original-Received: (qmail 13473 invoked by uid 76); 17 Sep 2005 05:17:46 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 13468 invoked from network); 17 Sep 2005 05:17:46 -0000 Original-To: Charles Duffy Mail-Followup-To: Charles Duffy , supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Xref: news.gmane.org gmane.comp.sysutils.supervision.general:879 Archived-At: On Fri, Sep 16, 2005 at 11:46:24PM -0500, Charles Duffy wrote: > Oh, and finally: Mixing tabs and whitespace is *abominable*. All tabs is > good (so folks can have the amount of whitespace they want just by > setting their editor, without needing to change the files). All > whitespace is acceptable. Mixing tabs and whitespace, on the other hand, > make an utter and complete *mess*. Bad! Evil! With all due respect to Gerrit, whose taste /can't/ be that bad given the excellent project he maintains and some of the very informed decisions he makes... Even "better" is when the indentation level suddenly decreases because the code block was too heavily nested. Faced with indentation levels that make it impossible to fit even simple statements on one line, he chooses to suddenly drop the indentation level rather than break-up the function. :) I ran runit through indent to fix it up once, and it wasn't recognizable any longer (nor were the over-nested sections legible). There's nothing wrong with a block of code into a subroutine, even if it's only used a single time. Declare it static (or better yet static inline if you use C99) and the compiler has all the information it needs to inline the function and eliminate the overhead (which was only a single subroutine worth anyway, so not going to show up on any profile - ever - unless it's called tens of thousands of times in a loop). As an added bonus, factor the right bits out and name them sensibly and your original function becomes easier to read, in the same way that the mind can easily substitute in what the printf() library call does, and the result is much more legible than seeing that giant mess of code inline.