Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!137.226.75.22.MISMATCH!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Recommendation for a good Android programming book? Date: Fri, 05 Jun 2015 13:59:05 -0400 Organization: A noiseless patient Spider Lines: 79 Message-ID: References: <54d7e90b-302b-45ef-8f55-22eb38e8c60d@googlegroups.com> <7c1d9qow7tvt.1hllzvzp9zig2.dlg@40tude.net> <556fa92c$0$295$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 5 Jun 2015 17:57:55 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="858a9d65d95f4ea4d355bd116aa2cdbf"; logging-data="6744"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JjaWuqkDvVACMmlQpjh4R" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: Cancel-Lock: sha1:u7c9Cx2dc1/sZL8xJcw90Qd3bnE= Xref: csiph.com comp.lang.java.programmer:31773 On 6/5/2015 1:30 PM, Martin Gregorie wrote: > On Fri, 05 Jun 2015 08:06:32 -0400, Eric Sosman wrote: > >> On 6/4/2015 5:00 PM, Martin Gregorie wrote: >>> On Wed, 03 Jun 2015 21:26:04 -0400, Arne Vajhøj wrote: >>> >>>> [sorry if duplicate post] >>>> >>>> On 5/26/2015 6:36 PM, Martin Gregorie wrote: >>>> > On Tue, 26 May 2015 17:21:32 -0400, Eric Sosman wrote: >>>> >> This is a more precise operation than a global >>>> >> search-and-replace, >>>> >> because the IDE can distinguish one `x' from another: If I rename >>>> >> one of my instance fields from `x' to `columnIndex', the IDE >>>> >> won't mess up the references to `x' in some other class like >>>> >> java.awt.Point. >>>> >> >>>> > I normally use microEmacs, which can do almost that: >>>> > >>>> > me org/gregorie/newproject/*.java >>>> > >>>> > Then tell it once only what I want it to replace and what with >>>> > just once and it works through all the files. I've never >>>> > discovered a limit to the number of files it can load. As a bonus >>>> > the search term can be a regex. >>>> >>>> Yes. But can it distinguish between different x's based on the meaning >>>> of the code within the files being edited? >>>> >>> No, unlike vi, where once you start an "s/x/y/" request running you >>> can't interfere, microEmacs approach is to ask what you want to do at >>> each match. The options are do it, skip this one, abandon (and it has >>> an undo facility) or to get on and do the lot. This lets you pick and >>> choose which matches to replace if you know that not all hits need >>> replacing (your 'x' case), or if you know that all should be replaced, >>> to check that the first one or two are working as expected and then let >>> it do the rest without asking. >> >> So, you get to see >> >> int value = things[i].x; >> >> ... and then you answer "yes" or "no?" >> > All are single keystrokes Y/y to make the change, N/n to skip it, Ctrl/C > to abort, ! to do the rest without prompts. I don't see what's hard about > that. I'll try to be clearer. Suppose you've got public class Thing { public final int x; ... } ... and you decide `columnIndex' would be a better name than `x'. In another file, perhaps, you've got Thing thing = ...; // has a field named `x' java.awt.Point point = ...; // has a field named `x' ... four hundred lines ... int value = theReference.x; Now the editor shows you the last of these lines and asks you to decide Y or N: Should the `x' change to `columnIndex', or should it remain as it is? The IDE will get this right every single time; I certainly couldn't, and I'd be surprised if you could. When I wrote my first programs, my editor of choice was the IBM 026 keypunch. Tools have improved -- and I've been glad to take advantage of the improvements, even though I'm temperamentally a bit of a Luddite. All I'm saying is that it's an error to judge today's tools by what yesterday's were like, even if they share a brand name. -- esosman@comcast-dot-net.invalid "Don't be afraid of work. Make work afraid of you." -- TLM