Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #31773
| 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 <esosman@comcast-dot-net.invalid> |
| 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 | <mksnv3$6io$1@dont-email.me> (permalink) |
| References | <mjj121$u5s$1@dont-email.me> <Android-20150522015201@ram.dialup.fu-berlin.de> <54d7e90b-302b-45ef-8f55-22eb38e8c60d@googlegroups.com> <mk0ps1$6uq$1@dont-email.me> <mk1h3a$eus$2@dont-email.me> <7c1d9qow7tvt.1hllzvzp9zig2.dlg@40tude.net> <mk2iup$m42$1@dont-email.me> <mk2o2o$ldm$1@dont-email.me> <mk2shj$5i4$1@dont-email.me> <556fa92c$0$295$14726298@news.sunsite.dk> <mkqe9c$bi5$1@dont-email.me> <mks3a1$cnm$1@dont-email.me> <mksmbl$t4s$1@dont-email.me> |
| 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 | <mksmbl$t4s$1@dont-email.me> |
| Cancel-Lock | sha1:u7c9Cx2dc1/sZL8xJcw90Qd3bnE= |
| Xref | csiph.com comp.lang.java.programmer:31773 |
Show key headers only | View raw
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
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Recommendation for a good Android programming book? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-05-20 15:16 -0700
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-05-21 20:30 -0400
Re: Recommendation for a good Android programming book? e.d.programmer@gmail.com - 2015-05-22 08:16 -0700
Re: Recommendation for a good Android programming book? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-05-25 20:40 -0700
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-05-26 10:15 +0000
Re: Recommendation for a good Android programming book? Joerg Meier <joergmmeier@arcor.de> - 2015-05-26 13:27 +0200
Re: Recommendation for a good Android programming book? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-05-26 07:33 -0700
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-05-26 19:52 +0000
Re: Recommendation for a good Android programming book? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-05-26 17:21 -0400
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-05-26 22:36 +0000
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-03 21:26 -0400
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-04 21:00 +0000
Re: Recommendation for a good Android programming book? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-06-05 08:06 -0400
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-05 17:30 +0000
Re: Recommendation for a good Android programming book? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-06-05 13:59 -0400
Re: Recommendation for a good Android programming book? e.d.programmer@gmail.com - 2015-06-05 05:50 -0700
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-05 17:35 +0000
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-06 23:50 -0400
Re: Recommendation for a good Android programming book? e.d.programmer@gmail.com - 2015-06-08 07:39 -0700
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-28 21:42 -0400
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-29 08:20 +0000
Re: Recommendation for a good Android programming book? Jeff Higgins <jeff@invalid.invalid> - 2015-06-29 05:49 -0400
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-29 07:37 -0400
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-29 07:35 -0400
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-29 15:01 +0000
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-29 14:08 -0400
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-29 14:18 -0400
Re: Recommendation for a good Android programming book? Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-29 21:00 +0000
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-07-27 22:22 -0400
Re: Recommendation for a good Android programming book? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-06 23:48 -0400
csiph-web