Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: The greeting code in Java Date: Tue, 21 Jun 2011 07:47:06 -0700 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: <3d6aab49-9a4a-4614-af12-bb1c95bebbe7@w4g2000yqm.googlegroups.com> <969l09FjduU8@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="7Qrvczazr82YckO5XW8Vtw"; logging-data="5960"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uh0uExJtuaBxG4oIS068fmQ94q2ItWKE=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:i7AIBcWK2gYyVPxx6MdMnoYFPp0= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5470 On Tue, 21 Jun 2011 09:34:34 +0000 (UTC), Tobias Blass wrote: [snip] >I know these quotes (every programmer should). >I didn't want to warn of using getchar. I must admit the performance thing was a >guess (and I think I read it somewhere), but even if it is the second part of >the sentence applies. Premature Optimization is mainly evil _because_ you >sacrifice simplicity (there are other reasons but this is the most important >one). This point was covered neatly in "Code Complete". At least, it was in the first edition. I have not read the latest. McConnell was writing encryption software to run on an original IBM pc. He optimised and optimised to speed up his C code. Finally, he hucked it and rewrote in Assembler. His observation was that as more and more optimisations were added, the code became much less readable. I like to optimise for code readability. If code is useful, it generally will have a long lifetime. That gives more opportunity for changes being required. Changes are a real bother when the code is not easily readable. Sincerely, Gene Wirchenko