Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: Holy boop: goto for Java Date: Tue, 05 Jun 2012 10:54:35 -0700 Organization: A noiseless patient Spider Lines: 35 Message-ID: References: <6AVyr.1859$8l2.827@newsfe14.iad> <77a353f2-0933-413a-8e47-df577ba64976@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="wKah3EH8kutwAOV6+9FiEQ"; logging-data="16207"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/s35FozrzoAl/C6p7F/ntUfxTpZH1SJHw=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:pMuqrhda2vFBgYeLocTAj7qHKrc= Xref: csiph.com comp.lang.java.programmer:15079 On Tue, 05 Jun 2012 10:51:13 -0700, Daniel Pitts wrote: >On 6/5/12 9:15 AM, Gene Wirchenko wrote: >> NO! Pulling some code out to make it a method that is called >> ONLY ONCE is what I object to. (I might do it if there is >> clearly-delineated functionality that could be useful again (but just >> happens to be needed but once when it written)). I will not do it for >> some manifesto. > >Code re-usability is the great lie that has become the manifesto, not >pulling out a once-used method. > >You don't create a method, or a class, or any other abstraction just so >that it is reusable. You create abstractions so that it is easier to >manipulate the software without breaking it. Yes, if you have the same >code in 3 places, pulling it into a method creates "reuse", but the >reason you reuse the code is so that changes to it appear *everywhere* >they should. Otherwise copy and paste would be an acceptable method of >code reuse. And its not. > >My philosophy on designing software is make it correct, make it simple, >make it pretty, make it fast. Usually (but granted not always) if you >start from the left, you'll end up at the right much easier than >starting at the right and going left. > >If making it simple or pretty involves pulling out a simple one-line >method that isn't used but once, then so be it. If pulling that method >out makes it uglier, then I don't do it. We are in violent agreement. Sincerely, Gene Wirchenko