[perl-python] Python documentation moronicities (continued)

X

Xah Lee

Let me expose one another fucking incompetent part of Python doc, in
illustration of the Info Tech industry's masturbation and ignorant
nature.

The official Python doc on regex syntax (
http://python.org/doc/2.4/lib/re-syntax.html ) says:

--begin quote--

"|"
A|B, where A and B can be arbitrary REs, creates a regular expression
that will match either A or B. An arbitrary number of REs can be
separated by the "|" in this way. This can be used inside groups (see
below) as well. As the target string is scanned, REs separated by "|"
are tried from left to right. When one pattern completely matches, that
branch is accepted. This means that once A matches, B will not be
tested further, even if it would produce a longer overall match. In
other words, the "|" operator is never greedy. To match a literal "|",
use \|, or enclose it inside a character class, as in [|].

--end quote--

Note: “In other words, the "|" operator is never greedy.â€

Note the need to inject the high-brow jargon “greedy†here as a
latch on sentence.

“never greedy� What is greedy anyway?

“Greedyâ€, when used in the context of computing, describes a
certain characteristics of algorithms. When a algorithm for a
minimizing/maximizing problem is such that, whenever it faced a choice
it simply chose the shortest path, without considering whether that
choice actually results in a optimal solution.

The rub is that such stratedgy will often not obtain optimal result in
most problems. If you go from New York to San Francisco and always
choose the road most directly facing your destination, you'll never get
on.

For a algorithm to be greedy, it is implied that it faces choices. In
the case of alternatives in regex "regex1|regex2|regex3", there is
really no selection involved, but following a given sequence.

What the writer were thinking when he latched on about greediness, is
that the result may not be from the pattern that matches the most
substring, therefore it is not “greedyâ€. It's not greedy Python
docer's ass.

Such blind jargon throwing, as found everywhere in tech docs, is a
significant reason why the computing industry is filled with shams the
likes of unix, Perl, Programing Patterns, eXtreme Programing,
“Universal Modeling Languageâ€, fucking shits.

----
A better writen doc for the complete regex module is at:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html

See also: Responsible Software Licensing
http://xahlee.org/UnixResource_dir/writ/responsible_license.html

Xah
(e-mail address removed)
∑ http://xahlee.org/
 
J

John Bokma

Xah said:
Let me expose one another fucking incompetent part of

your writing capablities?

If you really had a point, there wouldn't be any need of swearing...
 
R

Ron Adam

Xah said:
Let me expose one another fu....

Hello Xah,

I think you will continue to have difficulty getting respect on this
matter as long as you show disrespect to those who have come before you.

When you refer to the documentation as being f'ing stupid, and other
disrespectful terms, you are in an indirect, or depending on your
intent, directly insulting the people who have done their best, as
*volunteers* in most cases, to provide the existing documentation.

Text is never F'ing, Stupid, or any of the other terms you refer to as
it being. However it can be uninformative, hard to read, confusing, and
even plain wrong. But it is only text, and does not have a mind of it's
own. Referring to it as if it does, in such angry tones, reflects back
on yourself and gives others a poor impression of you.

At the start, you choose to approach this matter as a personal and
competitive agenda, ie.. You vs those who came before you. Is this
really the correct way to do this? You don't have to insult those who
came before you in order to make your case. If you do, then maybe your
case isn't strong enough. But even this is wrong because it isn't a
competition.

I suppose that if you respectfully offer something even a little better
it would be respectfully accepted, after due review of course. You will
probably even get many helpful suggestions along they way because you
will have created a situation where every one wins.

But by approaching it in the way you are, you make it very hard for
people to support you, because to do so, they have to take on the role
of losers in order for you to be a winner.

Just some thoughts, you might consider.

Cheers, and good luck with whatever aproach you decide.
 
P

Peter Hansen

Ron Adam rote:
I suppose that if you respectfully offer something even a little better
it would be respectfully accepted, after due review of course. You will
probably even get many helpful suggestions along they way because you
will have created a situation where every one wins.

Remarkably, and because of the special nature of this newsgroup, Ron is
right: "something even a little better" would be respectfully accepted,
in spite of the incredibly anti-social nature of nearly all of Xah' past
postings here.

In the (unlikely, IMHO) event that Xah can change, and wants to submit
something "even a little better", here are a few suggestions:

1. Use a spell checker.

2. Use a grammar checker. Many people can get away without this tool,
but pretty clearly Xah cannot.

3. Realize that posting partial improvements to this newsgroup will not
really help anyone, unless you are explicitly soliciting feedback on the
wording or structure with the intent of submitting the changes via the
proper channels at a later time.

4. Clean up all loose ends, including removing comments of the sort "to
be rewritten later", and "still needs work" and such. Somebody has to
do the work; if you leave it undone, the changes are unlikely to be
accepted.

-Peter
 
M

Mike Meyer

Xah Lee said:
Let me expose one another fucking incompetent part of Python doc, in
illustration of the Info Tech industry's masturbation and ignorant
nature.

What you actually expose is your own ignorance.
Note: “In other words, the "|" operator is never greedy.â€

Note the need to inject the high-brow jargon “greedy†here as a
latch on sentence.

Actually, greedy is a standard term when dealing with regular
expression matching. Anyone who's done even a little work with regular
expressions - which is pretty much all I've done, as I prefer to avoid
them - will know what it means.
“never greedy� What is greedy anyway?

“Greedyâ€, when used in the context of computing, describes a
certain characteristics of algorithms. When a algorithm for a
minimizing/maximizing problem is such that, whenever it faced a choice
it simply chose the shortest path, without considering whether that
choice actually results in a optimal solution.

Except that's not the *only* meaning for greedy in a computing
context. That's what it means when you're talking about a specific
kind of problem solving algorithm. Those algorithms have *nothing* to
do with regular expressions, so this definition is irrelevant.

After doing a google for "regular expression greedy", the second match
starts with the text:

By default, pattern matching is greedy, which means that the matcher
returns the longest match possible.

Now, it can be argued that the term ought not to be used, except that
it's a standard term with a well-known meaning, and exactly describes
the behavior in question.

You can argue that it ought to be defined. The problem is, you can't
explain things to a rock. You have to assume some basic level of
understanding. In particular, documentation on a regular expression
package should explain *how to use the package*, not what regular
expressions are, and the terminology associated with them.

As I've suggested before, what's really needed is a short tutorial on
regular expressions in general. That page could include a definition
of terms that are unique to regular expressions, and the re package
documentation could link the word greedy to that definition.

<mike
 
A

axel

In comp.lang.perl.misc Xah Lee said:
Let me expose one another fucking incompetent part of Python doc, in
illustration of the Info Tech industry's masturbation and ignorant
nature.
Note the need to inject the high-brow jargon “greedy†here as a
latch on sentence.
“never greedy� What is greedy anyway?
“Greedyâ€, when used in the context of computing, describes a

When used in terms of Usenet, I think it can be applied in the sense
of 'a troll who is greedy for attention'.

Hence the saying 'do not feed the troll'.

Axel
 
J

John Bokma

wrote:
When used in terms of Usenet, I think it can be applied in the sense
of 'a troll who is greedy for attention'.

Hence the saying 'do not feed the troll'.

Unless you can cause a buffer overflow :-D
 
T

Taenia Solium

Xah Lee said:
HTML Problems in Python Doc

Why dont you write a Mathematica tutorial instead ?

It looks like you know a little about Mathematica while
your knowledge of Python is abyssmal.
 
P

Peter Hansen

Mike said:
As I've suggested before, what's really needed is a short tutorial on
regular expressions in general. That page could include a definition
of terms that are unique to regular expressions, and the re package
documentation could link the word greedy to that definition.

You mean like http://www.amk.ca/python/howto/regex/ ?

Which as I recall is already linked from the Python re docs. (Perhaps
Xah's browser wasn't working that day...)

And which, at least implicitly, defines "greedy" by in section 6.3
titled "Greedy versus Non-Greedy". It's not perfect, but then nobody in
this thread has offered anything even remotely resembling perfect
documentation for regular expressions yet. <wink>

-Peter
 
S

Skip Montanaro

Peter> And which, at least implicitly, defines "greedy" by in section
Peter> 6.3 titled "Greedy versus Non-Greedy". It's not perfect, but
Peter> then nobody in this thread has offered anything even remotely
Peter> resembling perfect documentation for regular expressions
Peter> yet. <wink>

In the re syntax page:

http://www.python.org/dev/doc/devel/lib/re-syntax.html

the *?, +? and ?? operators *, + and ? are described as greedy:

*?, +?, ??
The "*", "+", and "?" qualifiers are all greedy; they match as much
text as possible. Sometimes this behaviour isn't desired; if the RE
<.*> is matched against '<H1>title</H1>', it will match the entire
string, and not just '<H1>'. Adding "?" after the qualifier makes it
perform the match in non-greedy or minimal fashion; as few
characters as possible will be matched. Using .*? in the previous
expression will match only '<H1>'.

{m,n}? is also described as a non-greedy version of {m,n} and A|B is
described as never being greedy (if A matches, B is never tried). Perhaps
there's no explicit definition of the word "greedy" in the context of
regular expressions, but I think that after reading that page most people
will at least have an intuitive notion of the meaning. If it's still
unclear, a little experimentation should suffice:
'a'

In short, I think the re docs are fine as-is w.r.t. the greedy concept. I
also added a definition to the Python Glossary for good measure:

http://www.python.org/moin/PythonGlossary

Feel free to amend/enhance/correct as you see fit. (Feel free to flesh out
any definitions for that matter, especially those with "???" as the
definition.)

Skip
 
F

Fredrik Lundh

Mike said:
After doing a google for "regular expression greedy", the second match
starts with the text:

By default, pattern matching is greedy, which means that the matcher
returns the longest match possible.

Now, it can be argued that the term ought not to be used, except that
it's a standard term with a well-known meaning, and exactly describes
the behavior in question.

fwiw, judging from frequently asked questions and bug reports,
people have no problems understanding the phrase "greedy", but
they sometimes have problems understanding why "return the
longest match possible" doesn't always mean "return the overall
longest match possible"

(using the greedy modifier only applies to the given RE operator;
it doesn't modify the behaviour of other operators, or the method
used; e.g. | will still pick the *first* possible match even if one of
the alternatives use a greedy operator, search/find still scans the
target string from left to right, etc).

</F>
 
X

Xah Lee

I think you will continue to have
difficulty getting respect on this
matter as long as you show disrespect
to those who have come before you.
...

Dear Ron Adam and other good people,

I respect people and I respect truth. And, the priority is truth first.

The software community, is one fucked up ball, and in part, because
people respect not people nor truth. They respect their own asses,
euphorimically known as politics and power game, and exhibited and
understood as respecting other people.

the above, as you've seen, can be seen in the behaviors and inactions
in this python group as judged by its posts on the Python doc issue i
raised. (of course there are also posts by good hearted and educated
people)

The documentations in computing industry and The Python doc in
particular, is one gravely fucking incompetent ball. And, execuse me
that most people do not understand this, but it is because people
respects their own asses more than other people or truth as i outlined
above.

The fucked up writings and thinkings in the computing industry is in
part what causes the sorry situation of today's software.

I, am taking my time as time permits to explain this situation little
by little to the computing public, message by message.

As to my criticism and rewrite of Python doc in particular, the Python
community can take it or leave it. If they take it, or if i instigated
any change, they shall give proper credit where credit is due.

-----
To the generic Python community:

go re-read my posts, and this time pay attention:
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
http://xahlee.org/perl-python/re-write_notes.html

These writings and my involvement with Python will probably only
increase. It is beneficial for you, either personally or as part of the
Python collective, to behave properly.

Xah
(e-mail address removed)
∑ http://xahlee.org/





Newsgroups: comp.lang.python
From: Ron Adam <[email protected]> - Find messages by this author
Date: Sat, 07 May 2005 20:23:35 -0400
Local: Sat,May 7 2005 8:23 pm
Subject: Re: New Python regex Doc
Reply | Reply to Author | Forward | Print | Individual Message |
Show original | Report Abuse

Xah said:
> Let me expose one another fu....

Hello Xah,

I think you will continue to have difficulty getting respect on this
matter as long as you show disrespect to those who have come before
you.

When you refer to the documentation as being f'ing stupid, and other
disrespectful terms, you are in an indirect, or depending on your
intent, directly insulting the people who have done their best, as
*volunteers* in most cases, to provide the existing documentation.

Text is never F'ing, Stupid, or any of the other terms you refer to as
it being.  However it can be uninformative, hard to read, confusing,
and
even plain wrong.  But it is only text, and does not have a mind of
it's
own.  Referring to it as if it does, in such angry tones, reflects
back
on yourself and gives others a poor impression of you.

At the start, you choose to approach this matter as a personal and
competitive agenda, ie.. You vs those who came before you.  Is this
really the correct way to do this?  You don't have to insult those
who
came before you in order to make your case.  If you do, then maybe
your
case isn't strong enough.  But even this is wrong because it isn't a
competition.

I suppose that if you respectfully offer something even a little better
it would be respectfully accepted, after due review of course.  You
will
probably even get many helpful suggestions along they way because you
will have created a situation where every one wins.

But by approaching it in the way you are, you make it very hard for
people to support you, because to do so, they have to take on the role
of losers in order for you to be a winner.

Just some thoughts, you might consider.

Cheers, and good luck with whatever aproach you decide.
 
J

John Bokma

Xah said:
I respect people

and I was convinced he was going to show different:
The software community, is one fucked up ball, and in part, because

just one person sees the light...
people respect not people nor truth. They respect their own asses,

Then you must be the #1 fine example of that same fucked up ball.
raised. (of course there are also posts by good hearted and educated
people)

Like yourself, sure.

If you had really any point, you didn't need to swear in every third
sentence. Nor bother so many groups with your rants.

If you think it can be done better, pick up a part of documentation, and
rewrite it. To make it very hard, you are not allowed to use ****, fucking,
fucked, ass, asses or other similar words, which in the way you use them
show quite some lack of both creativity and writing skills.
 
A

axel

In comp.lang.perl.misc John Bokma said:
If you had really any point, you didn't need to swear in every third
sentence. Nor bother so many groups with your rants.
If you think it can be done better, pick up a part of documentation, and
rewrite it. To make it very hard, you are not allowed to use ****, fucking,
fucked, ass, asses or other similar words, which in the way you use them
show quite some lack of both creativity and writing skills.

Oh please let him use an ass... then we might not see him again for
several months nutil his donley comes over the hill.

Axel
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top