Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!cbnewsm!gregk From: gregk@cbnewsm.att.com (gregory.p.kochanski) Newsgroups: comp.lang.c++ Subject: Re: C++ coding standards (Comment needed) Keywords: standard,variables Message-ID: <1990Aug13.121303.14104@cbnewsm.att.com> Date: 13 Aug 90 12:13:03 GMT References: <2161@runxtsa.runx.oz.au> Distribution: usa Organization: AT&T Bell Laboratories Lines: 15 In article <2161@runxtsa.runx.oz.au> edward@runxtsa.runx.oz.au (Edward Birch) writes: >A friend of mine works with a large organization where they have defined a >standard that "variables must be declared where first used". > >I think that this is an absolutely insane standard for the following reasons: Well, I'm not a true expert, but I've been using that coding style in both C and C++ for several years voluntarily, and I like it. It makes you think about just where you need this data, and there's less flipping around in the text editor looking for the declaration, as it's often on the same screen. I suppose it's a matter of taste. Of course, if you have small functions, this becomes a moot point. Greg Kochanski gpk@physics.att.com AT&T Physics Research -- Physics for fun and profit.