Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Style Police (a rant) Date: Sun, 11 Sep 2011 10:04:56 -0400 Organization: A noiseless patient Spider Lines: 35 Message-ID: References: <4e6c0fce$0$310$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 11 Sep 2011 14:06:22 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="f8igmItKsWs6nM5YanFxAA"; logging-data="22917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QiC96RixkNrvX99Is4WoH" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: Cancel-Lock: sha1:1j0ed6d0Gbli4Ntvg29gEPcUg3o= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7796 On 9/11/2011 9:23 AM, Andreas Leitgeb wrote: > Arne Vajhøj wrote: >> Sure you can learn your special style, but that does not >> help much when somebody else inherits your code. >> >> Better pick a language that work the way you want to code. >> > > Imagining myself in the role of a future maintainer of some code, > I'd surely feel more comfortable with Java-code written in some > strange (but consistent) style, than with code written in some > non-mainstream language Xyz. But maybe that's just me... I'd guess it's just you. Seriously. Today's mainstream language is tomorrow's "legacy" language, which means that tomorrow's maintainers will be more in tune with whatever has become popular than with old, out-of-fashion Java. Even those who were once Java whizzes will have seen their Java skills rust with disuse. When they pick up a chunk of old Java after years of working only in Snazzy, they will be on ground that is far less familiar than once it was. (Are your own personal COBOL/FORTRAN/ALGOL/... skills as sharp as they used to be?) It will therefore be helpful (or at least less un-helpful) if the code they see is not only self-consistent, but consistent with all the other Java code they once knew. "All" is surely too high a bar to clear, but "most" worth striving for. When writing code that's intended to survive (code has extraordinary and surprising longevity), you should have a really compelling reason to depart from norms, not just a stylistic preference. -- Eric Sosman esosman@ieee-dot-org.invalid