Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jan 2005 14:11:02 +0100
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        Paul Richards <paul@originative.co.uk>
Cc:        arch@freebsd.org
Subject:   Re: c99/c++ localised variable definition
Message-ID:  <xzpr7k4gz2x.fsf@dwp.des.no>
In-Reply-To: <20050128173327.GI61409@myrddin.originative.co.uk> (Paul Richards's message of "Fri, 28 Jan 2005 17:33:27 %2B0000")
References:  <20050128173327.GI61409@myrddin.originative.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Paul Richards <paul@originative.co.uk> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpr7k4gz2x.fsf>