Dummy regex question

S

Scott Bryce

JayEs said:
How much more accurate do I need to be?

You are missing the point. The reason that the first few responses did
not solve your problem was that you did not know what the problem
actually was. Therefore your problem description was not accurate.

* I asked a question with a clear description of the problem: How to split
string that contains a space.

But that wasn't really what you wanted to do.
* Proposed solution didn't do the job,

Proposed solution split on a space. That is what you had asked for.
after
some discussion Scott figured out what the problem was after I gave the NG a
code sample reproducing the problem. *

I figured out what the problem description really was. I suspected that
you did not really want to split on a space, but on something else. The
key was to find out what that something else was.

Not due to not giving inaccurate information,

Your information was inaccurate. You said you wanted to split on a
space. That wasn't what you really wanted to do.

but due to the problem being obfuscated by an idiosyncracy of
the OS (or so it seems).

No. Due to your not taking the time to find out what the problem really
was. That's OK. That is what debugging is a lot of the time.

So don't get defensive. Learn from the mistake. Next time a split
doesn't work as expected, double check the contents of the variable you
are splitting. And next time you post to this NG, include a short, but
complete program that demonstrates the problem. The key to solving the
problem was finding out what the problem was. Without your code, we
couldn't do that.
 
J

JayEs

So don't get defensive. Learn from the mistake.

Defensive? Little bit! Lucklily not offended, takes MUCH more :)
You are missing the point. The reason that the first few responses did not
solve your problem was that you did not know what the problem actually
was. Therefore your problem description was not accurate.

I liken this to asking how to turn on the light. Say, the main question is:
I have a room and it has an overhead fixture. How do I turn it on? That is a
very accurate question, with enough information to provide an answer. That
answer clearly should be: Find the switch and flip it.

Now even though this solution works for most, and is an adequate answer to
the above question, the originator of the question might not be able to get
this to work. The problem could be that the bulb is burnt out.

You have to take it one step at a time. If you don't know to flip the switch
then how can you know that the bulb is broke? Of course you could say that
you can shake the bulb and listen, even if you don't know to flip the
switch. But if the person asking to turn on the light doesn't even know how
to flip a switch then what is the likelyhood of this same person knowing to
shake the bulb? My point is that a question can lead to another question. In
this case, the person asked to be helped with switching on the light (How do
I split a string on a space -- accurate) and then comes back and says: That
didn't work, can you check the bulb for me?(here is the script see if you
can make it work -- code sample and all)
The person asking is new at the subject matter, its probably all the
information he knows to give...

If the person asking the question was so opposed to learning, he could have
foregone asking and light a candle, which might not have been as effective,
but he probably knows how to do and gets the job done in the end.
 
P

Paul Lalli

JayEs said:
I liken this to asking how to turn on the light. Say, the main question is:
I have a room and it has an overhead fixture. How do I turn it on? That is a
very accurate question, with enough information to provide an answer. That
answer clearly should be: Find the switch and flip it.

Yeah, but asking "how do I turn on the light" when you actually need to
know "how do I turn on the television" is not an accurate question.
My point is that a question can lead to another question. In
this case, the person asked to be helped with switching on the light (How do
I split a string on a space -- accurate)

No. Not accurate. That's the whole point. There WAS NO SPACE to split
on. You did not have a space. A space was not in your string. That is
the point everyone's trying to make you understand. Your string
contained either ' ' or "\xA0", neither of which is a space. A
space is ' '.

Paul Lalli
 
S

Scott Bryce

JayEs said:
I liken this to asking how to turn on the light. Say, the main question is:
I have a room and it has an overhead fixture. How do I turn it on? That is a
very accurate question, with enough information to provide an answer. That
answer clearly should be: Find the switch and flip it.

Your analogy breaks down. You were asking, "how do I flip this switch?"
You were told how, then complained that it didn't make the light go on.

Your problem wasn't with the switch.

The key to turning the light on was to find out what the problem really was.

I traced it back to the circuit breaker.

It is common for people asking questions on this newsgroup to think they
have isolated the problem, when the problem is really somewhere else.
That is why we ask you to post code. Often in the process of trimming
code, the poster will isolate the problem. If he can't isolate the
problem, the regulars here probably can, but not without your code.

So you posted your code and the real problem was found. I think that is
a good thing. You code works now, and next time you will post smarter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,802
Messages
2,569,661
Members
45,429
Latest member
FayeWagsta

Latest Threads

Top