X-Received: by 10.224.178.204 with SMTP id bn12mr2097701qab.1.1359082795095; Thu, 24 Jan 2013 18:59:55 -0800 (PST) X-Received: by 10.49.1.43 with SMTP id 11mr957488qej.29.1359082795048; Thu, 24 Jan 2013 18:59:55 -0800 (PST) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!p13no4865379qai.0!news-out.google.com!k2ni2738qap.0!nntp.google.com!p13no6654239qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Thu, 24 Jan 2013 18:59:54 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 69.28.149.29 References: <1q92g8hfr69f0422pq5r81cqqlpfngkotj@4ax.com> <89bbdac8-688c-4fbb-98ec-a1ae8ab25770@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7a1c356f-e9d7-4a2a-a4ec-836d55d9acda@googlegroups.com> Subject: Re: ctrl-c ctril-v From: Lew Injection-Date: Fri, 25 Jan 2013 02:59:55 +0000 Content-Type: text/plain; charset=ISO-8859-1 Lines: 44 Xref: csiph.com comp.lang.java.programmer:21685 Jim Janney wrote: > Lew writes: >> Jim Janney wrote: >>> This is a good thing. Programmers should not copy/paste on a regular >>> basis. > >> Ridiculous assertion. > > I wan't entirely serious when I wrote that. However... > > Any time I find myself faced with a lot of similar code, I do start > looking for ways to abstract out the similarities, in whatever language > I happen to be working in. Java is particularly rich in ways to > accomplish this. And for really trivial boilerplate code, any good > programming editor should provide ways to generate that that are both > more flexible and less error-prone than simple copy/paste. Again, > Eclipse is particularly rich in ways to accomplish this. > > I stand by my ridiculous assertion :-) It's too broad. Let's say I have a method name 'loadResourceFromBlarg()' and I'm programming with Eclipse or NetBeans or one of those editors. Now I could use Ctrl-space to get code completion, but if there are a number of 'loadResourceFromXxx()' methods, the completion list might take time. If there are many calls to the method of choice, I'll likely copy the method name once into the clipboard and repeatedly paste it. Let's say I'm importing static a bunch of members from a utility class. import static junit.framework.Assert.assertEquals import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertNotSame; import static junit.framework.Assert.assertTrue; It's much faster to copy "import static junit.framework.Assert.assert", repeatedly paste it and just type the part that varies. This type of thing comes up a *lot*, so I copy and paste on a regular and frequent basis. This has nothing to do with the refactoring of which you spoke. You're assertion was ridiculous because it banned legitimate uses of copy-paste. -- Lew