From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 1 18:59:27 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3343116A432; Mon, 1 Aug 2005 18:59:27 +0000 (GMT) (envelope-from frank@exit.com) Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0E7B43D46; Mon, 1 Aug 2005 18:59:26 +0000 (GMT) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.13.3/8.13.3) with SMTP id j71IxNg9077612; Mon, 1 Aug 2005 11:59:23 -0700 (PDT) (envelope-from frank@exit.com) Date: Mon, 1 Aug 2005 11:59:21 -0700 From: Frank Mayhar To: diz@linuxpowered.com Message-Id: <20050801115921.5ee26b78.frank@exit.com> In-Reply-To: <52275.68.95.232.238.1122920940.squirrel@68.95.232.238> References: <64511.68.95.232.238.1122917387.squirrel@68.95.232.238> <200508011355.19274.jhb@FreeBSD.org> <20050801180254.GB1176@beatrix.daedalusnetworks.priv> <20050801181014.GA14567@elvis.mu.org> <52275.68.95.232.238.1122920940.squirrel@68.95.232.238> Organization: Exit Consulting X-Mailer: Sylpheed version 2.0.0 (GTK+ 2.6.8; i386-portbld-freebsd5.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.86.1/1000/Sun Jul 31 12:28:06 2005 on tinker.exit.com X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: [patch] rc.d cleanup X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2005 18:59:27 -0000 On Mon, 1 Aug 2005 13:29:00 -0500 (CDT) diz@linuxpowered.com wrote: > Well I certainly respect the opinions, but respectfully when has the use > of && and || become obfuscation? Secondly, the use of shell style blocks > of code is similar to the way they are done in C where curly-braces are > used to enclose blocks of code. I honestly don't believe that it is > because of people who look at C and shell code, it is probably more due to > the foundation of all that existing shell code we read that does use IF > statements instead of logical AND/OR. That may be true for you, but I suspect that you don't write much (if any) C, do you? When one is accustomed to seeing standard if/else with proper indentation, the kind of thing you propose is indeed obfuscatory. This is one of the reasons that Perl is nearly unmaintainable, and that is the name of the game in one word: Maintainability. Most of us aren't experts in /bin/{ba}sh syntax, nor will we be. > What is the point of using a bulky > IF statement for the evaluating simple true/false situation that the shell > supports with && or ||? The point is that it is more clear. It expresses exactly what it is: A conditional statement in a programming language. The "&&" and "||" syntax is just a shortcut to do the same thing. Like most shortcuts, it has its place, but should be avoided when writing for a general audience. Ghods know I'm as guilty as anyone of violating this rule, but I try... -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/