From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QysFZ-0007Ov-M4 for qemu-devel@nongnu.org; Wed, 31 Aug 2011 17:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QysFY-00020Y-9O for qemu-devel@nongnu.org; Wed, 31 Aug 2011 17:23:09 -0400 Received: from nm6-vm0.bullet.mail.ukl.yahoo.com ([217.146.183.234]:40492) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QysFX-00020T-Qd for qemu-devel@nongnu.org; Wed, 31 Aug 2011 17:23:08 -0400 Message-ID: <1314825786.25905.YahooMailClassic@web27008.mail.ukl.yahoo.com> Date: Wed, 31 Aug 2011 22:23:06 +0100 (BST) From: bifferos In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Add support for r6040 NIC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , Blue Swirl Cc: qemu-devel@nongnu.org =0A--- On Wed, 31/8/11, Blue Swirl wrote:=0A=0A> I a= gree about importance of consistency, though I'd even go=0A> further and re= format globally. New code gets introduced =0A> based on copying old code so= the pain goes on.=0A=0AI think this is the most important point.=0A=0AI've= worked on many projects where coding standards were applied, generally the= order is:=0A=0A1) Someone comes up with some new standards=0A2) They want = to dictate the standards but are not prepared to invest any=0A effort in = making the existing code base conform to those standards=0A3) They decide i= t's too high risk to modify existing code=0A4) In conclusion they apply the= coding standards to new code only=0A5) Some... time... passes=0A6) Evangel= ist(s) responsible for coding standards leave the team=0A *or*=0A Are c= onvinced by other developers that coding standards suck=0A7) Repeat from 1)= , or drop coding standards=0A=0AI've seen this pattern pretty much without = fail, over the last 20 years of =0Acommercial software development. You ne= ver reach the standards utopia =0Aunless you retrospectively change all exi= sting code. The only way you=0Aever want to do that is if you have either= =0A=0Aa) Extensive unit tests=0Aor =0Ab) Balls=0A=0APreferably both!=0A=0AS= o what generally happens in experienced teams, is that you either =0Are-wor= k (only) the modules you touch, or you identify the coding =0Astandard of t= he module you're working on or the ones nearby and follow them.=0A=0AAltern= atively some developers write coding standards in a rather vague way=0Asuch= that there are no hard and fast rules. They categorise types of=0Aproblem= and their severity rather than using all rules as rejection=0Acriteria.=0A= =0ACouple of examples come to mind:=0A=0AWhen developing either driver or d= evice emulation software it's nice=0Ato use the same identifiers as the dat= a sheet. By forcing everything to lower case it makes it harder to cross-r= eference things, and God forbid if the data sheet actually used case to dis= tinguish registers you'd then have to invent identifiers to deal with it.= =0A=0AI looked around to see which license I could use, cribbed one from an= other Qemu file, and then promptly had to reformat it because it broke the = line length rule, so I've reformated what was previously a standard license= and crafted my own for no other reason that conforming with checkpatch.pl.= =0A=0Acheers,=0ABiff.=0A