Over at the Construction forum there is
a sticky post which list the suggested
posting guidelines for asking
question on that forum. First let me say the guidelines were my idea
however I didn't come up with them on my own. I had help. The idea
sprang from the fact I was getting tired of repeatedly having to as
each poster for the same bits of information. So the idea was to put
these standard questions in a central highly visible location
everyone could see. Where new poster could see what would be ask of
them and add that information to their first post. The standard
formula was
P1: Ask vague question
ME: Ask for more info
P1: Provide more info (maybe)
Me: Provide answer (maybe)
This being this be the best case but
often didn't go this smoothly. Variations would be
ask for two piece of addition
information get 1 (or none)
Answer question, Get response of “Oh
I forgot about this” or “but what about this unmentioned case”
Where step two and three could repeat
multiple times.
The point of the posting guidelines was
to eliminated the extra back and for so you get down to
P1: Ask detailed quest
Me: Answer
P1: Thanks (maybe)
Now if I were the grade how successful
the posting guidelines have been I have to give two grades.
Grade 1 (Posters asking questions): D-
Unsatisfactory passing. For the most
part people asking the questions won't follow the posting guidelines.
So in those cases nothing really changes. You still end up going
back and forth until you get the information you need to properly
answer the question. This is a waste of everyone's time, mostly for
the person asking the question. For those asking the question, it
just delays you getting an answer especially if the person responding
is on a different sleep cycle than you. You ask a question, hours
later someone on the other side of the planet starting their day
responds “Need more information”. However you've signed off for
the day. So the next day your respond but now the other person has
signed off for the day (or weekend) So now instead of having an
answer waiting on, you end up wait several more hours or days for an
answer.
In some case getting the asked for
information is like pulling teeth. I've always though it was strange
how some people are so unwilling to help you, help them. Maybe it's
because misery loves company and they want you to struggle with an
answer in the same way they have been struggling with the problem.
Sometime even after referring them to the guidelines people will
respond but still not provide any of the information asked for.
Sometimes they just rephrased their original query but add no new
information or at least nothing satisfying any of the guideline
request.
Some even get hostile about it. One
person stated he couldn't answer any of the guideline questions
because they were new to regex and didn't know anything about it.
Now that wasn't really a valid excuse since the questions don't
require any regex knowledge. The only one that even implies you have
any regex knowledge is “Show what you have tried” which implies
you have attempted to write a pattern. But if you haven't tried
anything, you can reply “I haven't trying anything”
A lot of people with post questions
with the mindset that you will answer while sitting in their lap. One
of the reasons we are asking for this info is because we can not see
what you are doing. We are not physically in the room with you. So
statements like “I have a text file”, or “I'm using a text
editor ...”
aren't helpful. We are not there, we
can't see your file, we can't see your editor, which we may have
never even heard of.
People will often post they are new to
regex. Sometimes I think the feel this excuses them for needing to
follow the guidelines. In fact it's just the opposite. They are the
one who need to be following the guidelines the closest. We've all
been in situations where we didn't understand something so much so we
didn't even know what questions to ask. Or in this case what
information is important and what is too much information. The
guidelines cover the most crucial information needed. The more of
this info provided the easier to answer your question becomes. The
less provided the more difficult to answer your question becomes,
irregardless if you are a regex noob or a vet.
The other thing, that I find annoying
is people asking for help saying it's not important for the people
answering to know what language they are using, or say it doesn't
matter what language platform the use to supply an answer. Why do
you think we would ask for unimportant information? The same is true
for all the guideline questions. Do those asking the questions think
these things were asked just because someone was nosy? Everything
asked is so that you can get the best answer as quickly as possible.
If you don't understand why the question matters, ask! But don't
tell the people trying to help you what parts of the information they
are asking for is important.
I said the the guidelines got two
grades. The second if for people actually answering the questions.
And for them the Guidelines get an A-(exceptional). The guidelines have been
around a few years now even before some the active members providing
the answers joined but in a lot of case I see them referring people
to them with no prompting by myself. Not everyone answering
reference the guidelines. Despite the things I just mentioned it is
possible to provide an answer following none of the guidelines. It
involves guessing and luck. Even if one ask a vague question,
someone might be able to guess what they actually wanted and answer
on the assumption and in some cases will be right. But that's mostly
luck. Luck that they are familiar with the data you are working
with. Just like above “sitting in your lap” people tend to assume
that everyone is as familiar with the data or tools they are using as
they themselves are. If you are lucky if that is true but nothing
guarantees that. Plus a host of other assumptions have to be made
and guessed correctly. Do you really want to rely on dumb luck every
time?
A simple example
Q: I need make sure a sting contains
only letters, what is the regex for that?
A: ^[a-zA-Z]*$
Assumptions made:
-
By letters the question referred
to letters of the English alphabet only
-
Spaces are not allowed
Now that pattern may be exactly what
the person asking wanted. But what if it wasn't. People asking these
questions come from all over the world, English may not be their
first language. The regex may not be intended to used against
English only input.
The more common and actual request I
see is when people say they need there regex to make “Special
Characters”. Now maybe I was sick the day that they announced
exactly which characters this term applies to and why they are
special but when people ask for this there doesn't seem to be a
consensus on which characters this includes. Now I could assume they
meant any non-alphanumeric character, or even just non-alphanumeric
characters on a keyboard. Of course this assumes we have the same
keyboard layout. But often people only want a few of these
characters. Which ones? Well that's part of the problem it varies.
Even if just limited to the keyboard which characters are special or
how many characters they are wanting differs by person.
One of the things that really tell that
those answering question are good with the guidelines is when you see
a person was answering questions or trying to that provided
incomplete information get frustrated by the back and forth of such
questions and start referring newer such post to the posting
guidelines.
As new regex pros joined the board and
start answering questions on a couple of occasions I have asked if
they had any changes, additions or deletions to they thought should
be added the to guidelines. The common answer is that the guidelines
are good as is. The only real addition suggested were adding a
Frequently Ask Question (FAQ) which while a good Idea since some
question get asked repeatedly, does provide useful information for
answering questions. Instead it would be more for preventing
questions from being asked again. Only thing is the questions to
vary slightly, like the afore mentioned “special characters” So
the questions would likely still get asked especially considering the
existing guidelines get ignored.
The only actual change from the first
posting of the guidelines is the additional of a example of a badly
asked question and template of a well asked question.
The actual guidelines can be found here http://regexadvice.com/forums/thread/60465.aspx but a quick summation of the 4 guidelines are
-
What programming
language/Application are you using?
-
What are you trying to do?
-
What have you tried to do?
-
Show the actual text you are
working with.
Now those who say they can't answer any of
these question because they don't know regex, a probably are about to
get fired from their job.
-
What programming language/Application
are you using?- If you are a programmer and you don't know the name
language you are doing your work in you are definitely in the wrong
job. If you are not a programmer or just using an application, how
can you not know the name of the application you are using or
planning to use. How did/will you launch it, or even find it on your
computer? How do you know it will even allow you to use a regex?
-
What are you trying to do? - If you
can't answer this, well... You are not being asked about your process you are being asked for your
goal. If you don't know your own goal why are you even asking others for help?
-
What have you tried to do? - Again
either you tried something or didn't try anything. If you have tried something please show it. If you haven't tried anything just say so.
-
Show the actual text you are working
with – Aside from security concerns which can be addressed, this
basically copy and paste.
Why do we want to know this
information?
-
Regular Expressions are not
uniform in all case. There are differences in syntax, features
offered and even how features work that vary from host environment.
And we aren't talking slight variations. In some cases the syntax
of one regex engine is over 50% different from another. All pattern
are not portable. Knowing the hosting environment makes it possible
to know what is available regex-wise.
-
Knowing the goal make giving an
answer easier, if there is an answer. In some cases the goal may
not be achievable with a regex or at all. Some solution require multiple patterns, some require programming code. Some goals are better
suited for a non-regex solution
-
Samples of what has been tried
provide, insight to host environment, level of regex knowledge or
knowledge of host environment. Code samples would show the language
being used. Some attempts show misunderstanding of regex. Some
attempts show syntax or logic errors in the host language code.
Some people were close to getting the pattern right themselves.
Others have had perfectly fine regex pattern but their host language
code was wrong. So there is nothing with the regex that needs fixing
there code needed to be corrected. Or even the pattern itself is
fine but needs to be adjusted for the host language.
-
This is very important but I have
already covered that in another post.
Generally people incorrectly assume
that if they make their question as minimal as possible it helps to
make it easier to answer. As far as regex goes the opposite is true.
The more details, the easier regex questions are to answer. Minimal
regex questions often lead to more questions. Detailed regex
questions often lead to quick answers.