In comp.lang.javascript message said:
Thomas 'PointedEars' Lahn said the following on 10/2/2007 4:05 PM:
I asked David Mark, without looking at the FAQ itself, what a function
named StrU does. The first thing a reasonable person in javascript
would assume is that it is a Constructor function. It isn't. After
that, what StrU does is a guess at best. Same goes for StrS. You can
find them in 4.6
A silly question to ask. Those who come across the name in the FAQ will
have found it in a section dealing with rounding to string, and so
should readily realise that StrU rounds to string. A URL is provided
for those who want to know more. Those who wish to use the routine in
their own code should choose a name for it that suits their own ways.
And the FAQEditor can do likewise, though it will then be necessary to
indicate that, in the URL cited, it's called StrU.
Those who come across it in active use will see that its context expects
it to return a string, and that its first argument has been calculated
whilst its other arguments are generally numeric literals. If they want
to know exactly what it does, they must look it up; if they then see it
again, they will recall its nature.
<ASIDE>
Let us postulate that there is, in the collection of code that you have
developed, a FAQworthy item. You would not put it in the FAQ; but you
might put a copy of it in the FAQ (edited to be good HTML). You would
need to take care that any updates or corrections were made twice.
I don't work that way. Backups and server apart, there is one single
copy of StrU stored on my site; it is in include1.js. Page js-rndg1.htm
shows its reader what StrU is; but it does not contain StrU. Function
ShoFFF, also in include1.js, is called with an argument list including
the identifier StrU, and, lo, my readers can read StrU while reading the
page dealing with it - and can be certain that what they read as StrU is
what is executed. And therefore I name my functions to suit myself.
Second. You have to ask yourself "Who is that document intended for?"
and the reasonable answer would have to be "For new people to learn
from". The code in the FAQ is abominable and about the worst place to
try to learn from.
Well, the code in that part of the FAQ is, as you know, out-of-date.
And, AFAIK, you have published nothing better.
Want another one? The variable name in 4.13 is just plain bad. Having a
variable named value in conjunction with code that gets the value
property from a form control is just plain bad practice.
Then the FAQEditor should change it.
Another one? DynWrite. At one time, it covered NN4 as well with a
document.layers branch. The document.layers branch was removed (the
document.all branch should have been removed at the same time also) but
the document.all branch was left at the behest of John Stockton
because, at the time, he was still using IE4 and complained about the
"people of the world who couldn't upgrade" (for whatever reason). That
same argument could be said about layers but layers left and the all
branch stayed.
Incomplete description. A substantial contribution to the removal of
the .layers part was the fact that it did not really work in NN4, or
worked only under unstated conditions.
Simple DynWrite function:
function DynWrite(elemID,stringToInsert){
document.getElementById(elemID).innerHTML = stringToInsert;
}
I raised that issue with it and was summarily dismissed on it and the
code stayed the way it is.
The flip side is that if you expand the code so that it is easily
readable, easy to follow, and has names that identify what the code
actually does, then the document grows to the point that the size of
the document becomes unbearably slow on a dial-up connection. So, do
you make the code "newbe friendly" or do you keep it dial-up friendly?
It is a trade off and the code has stayed the way it is.
That's been answered. In the days of Jim, the FAQ was split into two
parts, one part IIRC posted on Mon & Fri and the other on Wed. It could
easily be split into three parts, and maybe cycled fortnightly.
But remember : in a shortish routine, one should not give variables
fully-explanatory names; as names are used repeatedly, that's bloat.
Give them terse names or acronyms, with comment if needed to say what
they are.
And yes, I posted and wrote my thoughts about the code and was reminded
of the dial-up file size problem and summarily dismissed the idea of
re-writing all the code in the FAQ.
The answer to that is simple. Because that is not what I agreed to do.
And, I have opined on the fact that most of the code in the FAQ sucks
when it comes to trying to educate new people to javascript.
I don't recall that we in general agreed to your intended /modus
operandi/. The job was on offer, and you hastily grabbed it.
You want the job? It is yours my friend. Email me and I will give you
an address that Richard sent me for Jim. He can set you up with a login
username/password and all will be fine in the world.
That would be another stupid decision; and you have not been authorised
to select a successor. Jim Ley could write at great unreadable length,
but took care to avoid doing so in the FAQ. Richard could and did write
in that manner, though mainly in Notes. You prefer to spend your time
in self-justification and futile argument.
The key phrase there is "as your free time allows it". When people post
a request for it to be corrected/improved I don't merely dismiss it.
But, when that request is to move a line that doesn't exist, or, it
says "That is not code the author of that code now recommends" then
yes, I summarily dismiss it.
You were expected to do that. The statement was inserted for the
benefit of an earlier enquirer, one who might have used the extant FAQ
code. It should have encouraged him to try the links provided. IIRC,
That has been one of my requests/requirements from day one was that I
*would not* simply sit around all the time and peruse the web searching
for improvements. If people see a problem with it that needs to be
addressed, the least they can do is post a start to the solution and
help save some of *my* free time.
No : you are supposed to be an expert. Therefore it is likely that, a
problem having been pointed out, you would be easily able to insert an
appropriate improvement without more ado; otherwise, you should ask for
assistance. The people most likely to perceive that a FAQ entry is not
a sufficient answer are those who need a sufficient answer, and so
cannot provide one.
The thread that JRS posted in and pointed out two typos in the document
were corrected - locally - while I read the post. Very simple, very
informative post and I responded to it by correcting the errors.
I though there were 3 typos cited.
In contrast, there is also a thread where he obtusely referred to a
section that didn't exist and requested I move a line (that didn't
exist) to before/after another line. I asked for clarification and got
none. Guess what? Nothing got moved.
No : you assumed that 2.0 referred to a section, directly after a
reference to a new paragraph 2.5. That's either naive or perverse.
You could do one on a vote of confidence ...
And your dislike of the book is duly noted.
In your opinion. And, even then, the entry is staying for now. Even if
you think it to be not true.
The wording is not optimal for the purpose. Consider something like
"Most c.l.j regulars believe the best book to be", which is a far
sounder statement.
You should use c.l.j or CLJ, not clj which looks like a Slovenian swear-
word. I advise CLJ.
And, JFTR, my moods will dictate whether I use c.l.j or clj (with or
without the periods), not to what I refer to it as.
You should at least be consistent, and if possible correct : consistency
aids those who search with Ctrl-F or otherwise.
Your mood would, or could, improve, if you were to refrain from arguing
with TL. Just state your disagreement, and then ignore him.