On Sep 23, 6:44 pm, optimistx wrote:
Henry wrote:
>On Sep 23, 4:07 pm, jodleren wrote:
>>I know, that there are a lot of people having problems with
orkut.com,
<snip>
I am sure, that other poeple have problems, and I really
wonder what kind of problem it is.
<snip>
>If its Google then it must be incompetence.
/* satire mode on */
Yes, I agree. And if something is Microsoft then
it must be incompetence.
In fact, in my opinion every employee in those companies
is incompetent, each and everyone of tens of thousands
of people, without an exception.
As soon as a person is not employed by the Evil Companies,
and writes posts in c.l.j, he might become competent, expert,
provided he has never worked for the Evil (and hopefully
never will.)
Perhaps therefore it is very important to post here with one's real
name so that even their former employees can be recognized as
evil, incompetent people.
If an incompetent Google-person writes
var i = 1;
then the code is wrong, incompetent, idiot's work, the performance
is questionable, and there are sure to be evil spirits involved in
the lines.
If a c.l.j expert writes
var i = 1;
then the code is admirable,
There is no need to conjecture about code that Google employees may or
may not write when you can look at code that they actually do write,
and goes unchanged and unnoticed for year after year. An adequate
illustration can be found at:-
<URL:
http://groups.google.com/group/comp.lang.javascript >
- where viewing the source of the served page reveals:-
| <script language="javas cript"><!--
|
| // ----------------------------------
| // used for dynamic function generation on event handlers
|
| var loaddef = "";
| var resizedef = "";
|
| //-----------------------------------
| // Browser detection and support
|
| var agt = navigator.userA gent.toLowerCas e();
| var is_opera = (agt.indexOf("o pera") != -1);
| var is_ie = (agt.indexOf("m sie") != -1) && document.all && !
is_opera;
| var is_ie5 = (agt.indexOf("m sie 5") != -1) && document.all;
| window.agt = agt;
| window.is_opera = is_opera;
| window.is_ie = is_ie;
| window.is_ie5 = is_ie5;
|
| // ----------------------------------
| // cross-browser functions
|
| var IE_all_cache = new Object();
| function IE_getElementBy Id(id) {
| if (IE_all_cache[id] == null) {
| IE_all_cache[id] = document.all[id];
| }
| return IE_all_cache[id];
| }
|
| if (document.all) {
| if (!document.getE lementById) {
| document.getEle mentById = IE_getElementBy Id;
| }
| }
|
|
|
| //----------------------------------
| // Timezone detection (sets cookie)
|
| try {
| document.cookie = 'GTZ=' + (new Date()).getTime zoneOffset() +
| ';path=/;expires=Mon, 01-Jan-2024 00:00:01 GMT';
| } catch(e) {}
|
|
| // ---------------------------------
| // shelled functions for old javascript
| function tog() {}
|
| //--></script>
| <script language="javas cript1.3"><!--
|
| // ----------------------------------
| // visibility functions
|
| function tog() {
| // tog: toggle the visibility of html elements (arguments[1..])
| // from none to arguments[0]. Return what should be returned
| // in a javascript onevent().
| display = arguments[0];
| for( var i=1; i<arguments.len gth; i++ ) {
... and so on.
Disregarding user agent string based browser sniffing, the undeclared
variables that should be local (- display = arguments[0]; -) and the
perverse and redundant (-window.agt = agt; - with a previous global -
var agt = ... -), here there is an attempt to do something that, if it
were effective, might be admirable. Specifically, the use of various
forms of language="javas criptX.X" attributes in the SCRIPT elements in
an attempt to gain controlled outcomes in older browsers. Somebody has
obviously identified this as desirable and attempted to implement it
(or have someone else implement it).
Two language versions are employed by SCRIPT elements in the page's
source; version 1.3 and the generic language="javas cript", which means
any version from the first. Most of the code above is the main
language="javas cript" element where we see, for example, an
implementation of a substitute - document.getEle mentById - method for
IE 4 (IE 4 did not have that method and would not load
language="javas cript1.3" SCRIPT elements). We also see a dummy - tog
- function defined so that these older browsers will not error when
intrinsic event handlers attempt to call that - tog- function. The
real - tog - function is defined in a subsequent
language="javas cript1.3" SCRIPT element.
There are two problems with this. The first is the logic of the
targeted language versions. JavaScript 1.3 first shipped with Netscape
4.06 so from that versions on Netscape browsers will be loading
language="javas cript1.3" SCRIPT elements, and either producing syntax
errors as they attempt to interpret the code or runtime errors when
they attempt to execute it. Even if people are still using Netscape 4
the odds of them using a pre 4.06 version are extremely low
(particularly as, while they were still distributing it, Netscape
recommended that nobody use a pre 4.78 version due to serious security
flaws in earlier versions).
The second problem, and the totally fatal one, is that sitting in the
middle of the language="javas cript" SCRIPT element (the one that is
supposed to provide the fall-back) is a try/catch block, and try/catch
was introduced in JavaScript 1.4, JScript 5 and ECMAScript 3, which
translates to Opera 5+, IE 5+, Netscape 6+ (and Mozilla/Gecko/
Firefox). Try/catch is a syntax error in all previously language
versions, and the code in elements that contain any syntax errors will
never be evaluated. Thus, on (all off) the very browsers that will not
process the language="javas cript1.3" the SCRIPT element that is
supposed to be providing their fall-back will never be evaluated due
to the syntax error, rendering the whole exercise self-defeating.
A competent javascript developer would see this within a few seconds
of starting to try to understand what the javascript on the page does.
Obviously its author(s) did not know enough to avoid writing code that
defeated its own best efforts, but that is not unusual in itself as
the individual doing a job like that could be quite junior. The
significant indication of this is that whoever is in charge of this
authoring effort, the most senior/knowledgeable developer involved,
did not see this mistake (whether through not looking or looking but
not knowing enough to recognise it when seen), and that is
incompetence. It is also the norm for Google javascript authoring.
(The apparent absence of any (effective) QA prior to deployment might
also be the subject of criticism, but that is Google management's
incompetence not its web developer's)
following standards, correctly posted with correct signature and
quotation, with correct software and there are good spirits in
it, glory glory halleluja .
I hope some day I could become an expert here.
/* satire mode off */
Whine a lot, don't you?