From owner-freebsd-arch@FreeBSD.ORG Sat Jan 29 13:11:29 2005 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39BB816A4CE for ; Sat, 29 Jan 2005 13:11:29 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id E52ED43D41 for ; Sat, 29 Jan 2005 13:11:28 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 7882E530C; Sat, 29 Jan 2005 14:11:27 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 335535308; Sat, 29 Jan 2005 14:11:03 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id B54CDB869; Sat, 29 Jan 2005 14:11:02 +0100 (CET) To: Paul Richards References: <20050128173327.GI61409@myrddin.originative.co.uk> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sat, 29 Jan 2005 14:11:02 +0100 In-Reply-To: <20050128173327.GI61409@myrddin.originative.co.uk> (Paul Richards's message of "Fri, 28 Jan 2005 17:33:27 +0000") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on flood.des.no X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,FORGED_RCVD_HELO autolearn=disabled version=3.0.1 cc: arch@freebsd.org Subject: Re: c99/c++ localised variable definition X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2005 13:11:29 -0000 Paul Richards writes: > People used to programming in C++ or Perl (and many others) are used > to defining variables as near to use as possible. This have never been > possible before in C, but now with c99 it is. It's a very bad idea, because you can introduce new variables whenever you feel like, but you can't destroy them. Defining variables at the top of the scope forces you to think about which variables you need and how long they will live. Defining them on an ad hoc basis leads to sloppy programming and stack abuse. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no