Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #7976 > unrolled thread

Getting Starting in JavaScript et al

Started byGene Wirchenko <genew@ocis.net>
First post2011-11-03 20:41 -0700
Last post2011-11-08 14:52 -0800
Articles 20 on this page of 26 — 13 participants

Back to article view | Back to comp.lang.javascript


Contents

  Getting Starting in JavaScript et al Gene Wirchenko <genew@ocis.net> - 2011-11-03 20:41 -0700
    Re: Getting Starting in JavaScript et al BOOK-AZ <amalguseynov@gmail.com> - 2011-11-04 00:15 -0700
    Re: Getting Starting in JavaScript et al Christian Kirsch <ck@bru6.de> - 2011-11-04 10:30 +0100
      Re: Getting Starting in JavaScript et al Gene Wirchenko <genew@ocis.net> - 2011-11-04 10:00 -0700
        Re: Getting Starting in JavaScript et al Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-04 20:46 +0100
          Re: Getting Starting in JavaScript et al Gene Wirchenko <genew@ocis.net> - 2011-11-04 13:06 -0700
            Re: Getting Starting in JavaScript et al Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-04 21:13 +0100
            Re: Getting Starting in JavaScript et al Clot Hears <yule@never.know> - 2011-11-04 21:55 +0000
        Re: Getting Starting in JavaScript et al "Richard Cornford" <Richard@litotes.demon.co.uk> - 2011-11-05 04:14 +0000
          Re: Getting Starting in JavaScript et al Elegie <elegie@anonymous.invalid> - 2011-11-05 09:58 +0100
            Re: Getting Starting in JavaScript et al Richard Cornford <Richard@litotes.demon.co.uk> - 2011-11-08 03:33 -0800
              Re: Getting Starting in JavaScript et al Scott Sauyet <scott.sauyet@gmail.com> - 2011-11-08 05:23 -0800
                Re: Getting Starting in JavaScript et al Richard Cornford <Richard@litotes.demon.co.uk> - 2011-11-08 06:21 -0800
                  Re: Getting Starting in JavaScript et al Gene Wirchenko <genew@ocis.net> - 2011-11-08 14:49 -0800
                  Re: Getting Starting in JavaScript et al Scott Sauyet <scott.sauyet@gmail.com> - 2011-11-09 05:10 -0800
              Re: Getting Starting in JavaScript et al Elegie <elegie@anonymous.invalid> - 2011-11-08 19:14 +0100
    Re: Getting Starting in JavaScript et al Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-11-04 11:55 +0100
      Re: Getting Starting in JavaScript et al Gene Wirchenko <genew@ocis.net> - 2011-11-04 09:54 -0700
    Re: Getting Starting in JavaScript et al Elegie <elegie@anonymous.invalid> - 2011-11-04 22:45 +0100
    Re: Getting Starting in JavaScript et al Sean Kinsey <okinsey@gmail.com> - 2011-11-05 04:07 -0700
      Re: Getting Starting in JavaScript et al "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-11-05 12:13 +0000
      Re: Getting Starting in JavaScript et al beegee <bgulian@gmail.com> - 2011-11-06 06:59 -0800
        Re: Getting Starting in JavaScript et al Gene Wirchenko <genew@ocis.net> - 2011-11-08 14:57 -0800
          Re: Getting Starting in JavaScript et al beegee <bgulian@gmail.com> - 2011-11-09 13:04 -0800
      Re: Getting Starting in JavaScript et al Richard Cornford <Richard@litotes.demon.co.uk> - 2011-11-08 03:38 -0800
      Re: Getting Starting in JavaScript et al Gene Wirchenko <genew@ocis.net> - 2011-11-08 14:52 -0800

Page 1 of 2  [1] 2  Next page →


#7976 — Getting Starting in JavaScript et al

FromGene Wirchenko <genew@ocis.net>
Date2011-11-03 20:41 -0700
SubjectGetting Starting in JavaScript et al
Message-ID<03n6b7ltoilu01ugksc9hn9ldd4a18b99e@4ax.com>
Hello:

     The company that I work for is going for a Web-based frontend for
its client billing system and to integrate the various company
databases and applications.

     The app will be internal for the projected future.  The browser
will be IE 9, the OS Windows 7.  We will be using SQL Server Express
for the DBMS.  For the Web end, it will be JavaScript, VBScript, ASP
Classic, and AJAX.

     I have some sample code, but have already found deficiencies with
it.  I have dealt with some of the deficiencies (escape characters was
a big one), but it has been a slow and arduous time.

     I have found that there are many basic guides on the Web, but all
too few that get into the nasty bits.  For example, escape characters
are not dealt by many pages, and I had to do a lot of hunting to find
out what to do.

     I have read/skimmed the FAQ, and much of it is too high a level
for me for now.

     Are there any gotchas that I should be particularly alert for?

     Are there any good books that get into the nasty bits?  (Of the
two mnetioned in the FAQ, one does not seem appropriate.  The other
one, I am not sure about.)

     You can read my questions as being about JavaScript specifically
or the conglomerate of systems I mentioned.  I could use help with
both.

Sincerely,

Gene Wirchenko

[toc] | [next] | [standalone]


#7977

FromBOOK-AZ <amalguseynov@gmail.com>
Date2011-11-04 00:15 -0700
Message-ID<aeae745a-1a95-4eae-9353-b3d9f19f1992@s9g2000yqi.googlegroups.com>
In reply to#7976
Семимиллиардный житель Земли получил тонну апельсинов http://book-az.com

[toc] | [prev] | [next] | [standalone]


#7979

FromChristian Kirsch <ck@bru6.de>
Date2011-11-04 10:30 +0100
Message-ID<4eb3b0a7$0$6563$9b4e6d93@newsspool4.arcor-online.net>
In reply to#7976
Gene Wirchenko schrieb:

>      You can read my questions as being about JavaScript specifically
> or the conglomerate of systems I mentioned.  I could use help with
> both.
>

But what *are* your questions? You mention one thing ("escape
characters"), and I don't even understand, what you mean by this. If you
want answers, you should probably be asking clear questions.

[toc] | [prev] | [next] | [standalone]


#7994

FromGene Wirchenko <genew@ocis.net>
Date2011-11-04 10:00 -0700
Message-ID<1768b7td015h7anlq23aca355vmrvlorm3@4ax.com>
In reply to#7979
On Fri, 04 Nov 2011 10:30:14 +0100, Christian Kirsch <ck@bru6.de>
wrote:

>Gene Wirchenko schrieb:
>
>>      You can read my questions as being about JavaScript specifically
>> or the conglomerate of systems I mentioned.  I could use help with
>> both.

>But what *are* your questions? You mention one thing ("escape

     They are the sentences that end with "?".  Here they are again:

     Are there any gotchas that I should be particularly alert for?

     Are there any good books that get into the nasty bits?

>characters"), and I don't even understand, what you mean by this. If you

     Maybe you use different terminology?  In some languages, to
represent certain characters in a string, one must escape the
character.  C example:
          char tab='\t';
tab would then contain the tab character, not a backslash followed by
a lower-case T.

>want answers, you should probably be asking clear questions.

     One of the problems of getting started is finding out exactly
where to start.  When I have specific questions, I will ask them.  For
now, I am trying to get the lay of the land.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#8002

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-11-04 20:46 +0100
Message-ID<1542235.qVoOGUtdWV@PointedEars.de>
In reply to#7994
Gene Wirchenko wrote:

> Christian Kirsch wrote:
>> Gene Wirchenko schrieb:
>>>      You can read my questions as being about JavaScript specifically
>>> or the conglomerate of systems I mentioned.  I could use help with
>>> both.
>> 
>> But what *are* your questions? You mention one thing ("escape
> 
>      They are the sentences that end with "?".  Here they are again:
> 
>      Are there any gotchas that I should be particularly alert for?
> 
>      Are there any good books that get into the nasty bits?

You are just asking for it:

<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#8004

FromGene Wirchenko <genew@ocis.net>
Date2011-11-04 13:06 -0700
Message-ID<p7h8b7pvi5ps283l3qmmrer1h4doilhknu@4ax.com>
In reply to#8002
On Fri, 04 Nov 2011 20:46:46 +0100, Thomas 'PointedEars' Lahn
<PointedEars@web.de> wrote:

>Gene Wirchenko wrote:
>
>> Christian Kirsch wrote:
>>> Gene Wirchenko schrieb:
>>>>      You can read my questions as being about JavaScript specifically
>>>> or the conglomerate of systems I mentioned.  I could use help with
>>>> both.
>>> 
>>> But what *are* your questions? You mention one thing ("escape
>> 
>>      They are the sentences that end with "?".  Here they are again:
>> 
>>      Are there any gotchas that I should be particularly alert for?
>> 
>>      Are there any good books that get into the nasty bits?
>
>You are just asking for it:
>
><http://www.catb.org/~esr/faqs/smart-questions.html>

     I was wondering if it were your past history with others or that
you were just plain rude.  Unfortunately, your reply strongly suggests
it to be the latter.

     Just in case the above gave you a bit of pause, how would you (as
a newbie) ask for a book on the subject of your newbieness that deals
with non-trivial uses?

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#8006

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-11-04 21:13 +0100
Message-ID<4771979.ypaU67uLZW@PointedEars.de>
In reply to#8004
Gene Wirchenko wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Gene Wirchenko wrote:
>>> Christian Kirsch wrote:
>>>> Gene Wirchenko schrieb:
>>>>>      You can read my questions as being about JavaScript specifically
>>>>> or the conglomerate of systems I mentioned.  I could use help with
>>>>> both.
>>>> 
>>>> But what *are* your questions? You mention one thing ("escape
>>> 
>>>      They are the sentences that end with "?".  Here they are again:
>>> 
>>>      Are there any gotchas that I should be particularly alert for?
>>> 
>>>      Are there any good books that get into the nasty bits?
>>
>> You are just asking for it:
>>
>> <http://www.catb.org/~esr/faqs/smart-questions.html>
> 
>      I was wondering if it were your past history with others or that
> you were just plain rude.  Unfortunately, your reply strongly suggests
> it to be the latter.

*PLONK*

[toc] | [prev] | [next] | [standalone]


#8020

FromClot Hears <yule@never.know>
Date2011-11-04 21:55 +0000
Message-ID<yule-9BA538.21551404112011@news.individual.net>
In reply to#8004
In article <p7h8b7pvi5ps283l3qmmrer1h4doilhknu@4ax.com>,
 Gene Wirchenko <genew@ocis.net> wrote:

> On Fri, 04 Nov 2011 20:46:46 +0100, Thomas 'PointedEars' Lahn
> <PointedEars@web.de> wrote:
> 
> >Gene Wirchenko wrote:
> >
> >> Christian Kirsch wrote:
> >>> Gene Wirchenko schrieb:
> >>>>      You can read my questions as being about JavaScript specifically
> >>>> or the conglomerate of systems I mentioned.  I could use help with
> >>>> both.
> >>> 
> >>> But what *are* your questions? You mention one thing ("escape
> >> 
> >>      They are the sentences that end with "?".  Here they are again:
> >> 
> >>      Are there any gotchas that I should be particularly alert for?
> >> 
> >>      Are there any good books that get into the nasty bits?
> >
> >You are just asking for it:
> >
> ><http://www.catb.org/~esr/faqs/smart-questions.html>
> 
>      I was wondering if it were your past history with others or that
> you were just plain rude.  Unfortunately, your reply strongly suggests
> it to be the latter.

It *is* the latter. But don't worry, he says that to *all* the girls.
-- 
Clothears

[toc] | [prev] | [next] | [standalone]


#8029

From"Richard Cornford" <Richard@litotes.demon.co.uk>
Date2011-11-05 04:14 +0000
Message-ID<8pCdnaiKPMrfJSnTnZ2dnUVZ8vidnZ2d@giganews.com>
In reply to#7994
Gene Wirchenko wrote:
> On Fri, 04 Nov 2011 10:30:14 +0100, Christian Kirsch wrote:
>
>>Gene Wirchenko schrieb:
>>
>>>      You can read my questions as being about JavaScript 
>>> specifically
>>> or the conglomerate of systems I mentioned.  I could use help with
>>> both.
>
>>But what *are* your questions? You mention one thing ("escape
>
>     They are the sentences that end with "?".  Here they are again:
>
>     Are there any gotchas that I should be particularly alert for?

For some reason the biggest "gotcha" with javascript is premature 
confidence. There seem to be  recurrent manifestations of the 
Dunning-Kruger effect (if you are not familiar with than look it up as 
it is an interesting, and all too human, psychological phenomenon). To 
date I have had three epiphanies where I have suddenly "got" javascript 
and realized how utterly diffident my previous understanding of the 
subject had been. For the perspective following the third I realized 
that 1. the code I was writing after the first epiphany was so bad it 
was actively dangerous (to the people who were employing me to write 
it), and 2. that there is no good reason to be certain that I have 
actually "got" javascript now (event given that I have been writing 
nothing but javascript full time for the last 8 years).

The next general "gotcha" is related to the first. Premature (but 
actually unjustified) confidence, if examined, would lead to cognitive 
dissonance, humans deal with that by irrationally re-enforcing and 
bolstering the decisions that they have made. This manifests itself in 
some people adopting a religion-like attitude towards some aspects of 
browser scripting, and you will find these people writing all over the 
internet. Generally you want to be interested in the reasoning that 
backs any position that anyone takes (how good are their actual 
arguments) and be very wary of those who only assert that they are/were 
correct (and particularly those who will not listen to/engage with 
criticism).

Recently I had to write a technical test for some JS programmer 
interview. I tried to include every common misconception about 
javascript that I have noticed. These are (most of) the points I tested 
for that bset qualify as "gotchas":-

1. Understanding the factors that determine the - this - value in 
javascript code; That it is determined by how you call a function/method 
and not, for example, which object that function/method may 'belong' to.

2. Clearly seeing the boundaries between the programming language and 
the environment that the browser provides to be programmed; the 
distinctions between what the 3rd edition of the language specification 
term "host objects", "built-in objects" and "native object".

3. Identifying and understanding the types of values that javascript 
uses; that there are 5 primitive data types (boolean, number, string, 
null and the undefined type). You can create String, Number and Boolean 
objects (explicitly or implicitly) but those objects are distinct from 
their corresponding primitive types. (Java programmers are particularly 
fond of assuming the string primitive type is actually an object 
instance created (implicitly) with the String constructor, it is not.)

4. Understanding that in a loosely types language it is the programmer's 
responsibility to keep track of the types of the values that any 
particularly variable/property/parameter will/may have; to know when and 
what implicit type conversions will occur and avoid every having the 
need to exhaustively test the type of an unknown value (particularly 
function arguments).

5. The specification for the User Agent header and the corresponding 
userAgent property of the navigator object defines its contents as an 
effectively arbitrary sequence of characters that does not even need to 
be identical for two consecutive HTTP requests. This means that there is 
no technical basis for assuming that the userAgent property can be used 
as a means of identifying web browser types or versions. Tempting as it 
may seem at times, driving script behaviour on the bases of a limited 
set of observations of what example userAgent strings may have contained 
at some time is a common mistake, and takes quite a bit of fixing once 
reality hits home.

5. Confusing javascript's object/array literals with the (necessarily) 
much more formal JSON.

6. Assumptions/Inferences about web browser environments are dangerous 
and should not be used if they can be avoided (and they can be avoided 
much more often than people seem to think). For example:-

if(document.images){
    var img1 = new Image();
    img1.src = 'foo.png';
}

- tests for the existence of - document.images - in order to guard 
against the use of the - Image - constructor in browsers that don't 
support it. These two features were introduced together so in practice 
this test (which was a common construct, and is given as an example of 
'best practice' in some places) did not fail significantly (To the best 
of my knowledge it only failed in versions of IceBrowser between 2 and 
5, and that browser was so little used that few are even aware that it 
ever existed (and it is now dead)). However, if the point is to guard 
against attempting to use the - Image - constructor in an environment 
where it is not available then the logical subject for the test is the - 
Image - constructor itself. When you cannot find the constructor then it 
is not there, and you shouldn't try to use it.

The general rule for feature testing is; design the test with its 
subject having as close a relationship as possible to the feature that 
is to be used, and preferably a one-to-one relationship.

7. Failing to learn the javascript related technologies (HTML, DOM, CSS 
and HTTP (at minimum)) formally.  That is, become sufficiently familiar 
with their specification to know what is there, and where to look in 
order to find the answers to the questions that you may have about them.

>     Are there any good books that get into the nasty bits?

It was the books that I first read on javascript that got me to the 
point of writing code that was actively dangerous. Be very careful with 
javascript books; 60%+ factually false is no unknown and I would be 
supported to see worthwhile script design advice (given what I have seen 
to date).

>>characters"), and I don't even understand, what you mean by this. If 
>>you
>
>     Maybe you use different terminology?  In some languages, to
> represent certain characters in a string, one must escape the
> character.  C example:
>          char tab='\t';
> tab would then contain the tab character, not a backslash followed by
> a lower-case T.

Escaping is necessary but can be very context dependent. If you get an 
arbitrary sting out of a database what you are going to have to do to it 
in order to render it 'safe' depends on where it is going to end up. If 
it is going into a javascript string then it needs one set escaping, if 
its destination is as text in an HTML element then it needs another, 
while an HTML attribute may need another. Then there are things like 
inserting data as a javascript string that will be used as part of a URL 
in the code that will be used for an HTML intrinsic event attribute; 
that is three possible levels of escaping for different contexts, that 
will need to be applied in the correct order.

Javascript has escape sequences that start with a backslash, but there 
are a number of types. So '\t' (the tab) may also be the hexadecimal 
escape sequence '\x09' and the Unicode escape sequence '\u0009'. Notice 
that the Unicode sequence can accommodate a much wider range of 
characters. A little worthwhile advice; you will usually need to escape 
quote marks and apostrophes for use inside javascript string, but if you 
do that by just preceding them with a backslash then the quote character 
is still in the source text and so may need handling at a separate level 
in the escaping process. But if you use a hexadecimal or a Unicode 
escape sequence instead then the problematic character is gone from that 
point forward (and the remaining backslash is both easier to handle and 
less often problematic (e.g. not a character that HTML treats as 
special).

Also, IE's JScript has had (may still have, I have not checked this in 
IE9 yet) a long standing but where the escape sequence '\v' was taken as 
a literal 'v' when it should have been treated as a vertical tab. You 
don't see vertical tabs often but if they are going to be escaped it is 
definitely more predictable to escape then to a hexadecimal or Unicode 
sequence.

Escaping forward slashes may seem unnecessary. However, I have seen 
(possibly overzealous) security software objecting to seeing them in URL 
query strings and I have a recollection of seeing a JSON script 
insertion strategy that would be neutralised by unconditionally escaping 
that character.

The set of characters that probably should be escaped when included in a 
javascript string are the backslash, apostrophe, double quote, carriage 
return (\x0D), line feed (\x0A), form feed (\x0C), line separator 
(\u2028) and paragraph separator(\u2029). I would also habitually escape 
backspace (\x08), Horizontal tab, vertical tab (\x0B), BOM (\uFEFF) and 
the forward slash. Always escape the escape character first when 
escaping and unescape it last when unescaping (backslash when escaping 
for javascript, but whichever escape character is used in whichever 
context: it is a rule and an oft forgotten one).

>>want answers, you should probably be asking clear questions.
>
>     One of the problems of getting started is finding out exactly
> where to start.  When I have specific questions, I will ask them.  For
> now, I am trying to get the lay of the land.

No matter how bad things may look they are actually 100 times better 
than they were 10 years ago, and people learnt to coped back then.

Richard. 

[toc] | [prev] | [next] | [standalone]


#8031

FromElegie <elegie@anonymous.invalid>
Date2011-11-05 09:58 +0100
Message-ID<4eb4fac4$0$8435$426a34cc@news.free.fr>
In reply to#8029
On 05/11/2011 05:14, Richard Cornford wrote :

Hi Richard,

> For some reason the biggest "gotcha" with javascript is premature
> confidence. There seem to be recurrent manifestations of the
> Dunning-Kruger effect (if you are not familiar with than look it up as
> it is an interesting, and all too human, psychological phenomenon).

<snip>

I did not know about it, but I like it very much. I believe I have seen 
this many times (including in my own behavior), and will surely reuse that.

I recently tried and used the following to express similar ideas (but I 
don't know if it was well-received):

"No knowledge is innocence, a bit of knowledge is obscurantism, a lot of 
knowledge is wisdom".

Innocence is a blank page on which you can write things; it is also the 
state before the mind becomes corrupted.

Obscurantism happens when you refuse to learn more and believe that what 
you have learnt is right. When an innocent person first learns 
something, and manages to put it in practice successfully, then he/she 
will gain confidence in both what they have learnt and their ability to 
learn. Success is sometimes worth less that failure, in that it can 
hinders further learning.

Wisdom happens when you realize that the more you learn, the less you 
know. It does not mean that your actual knowledge is shrinking (quite 
the contrary), but rather that your horizon is expanding faster than you 
learn. True wisdom is not about knowledge, but about attitude.

> Recently I had to write a technical test for some JS programmer
> interview. I tried to include every common misconception about
> javascript that I have noticed. These are (most of) the points I tested
> for that bset qualify as "gotchas":-

<snip>

This is an interesting idea. Experts usually judge a script by these 
very criteria, so formulating a test requiring an explicit usage of them 
by the candidate appears quite logical.

Regards,
Elegie.

[toc] | [prev] | [next] | [standalone]


#8126

FromRichard Cornford <Richard@litotes.demon.co.uk>
Date2011-11-08 03:33 -0800
Message-ID<bce65e9a-590d-4f69-bc7d-d0a78a1703d9@e3g2000vbs.googlegroups.com>
In reply to#8031
On Nov 5, 8:58 am, Elegie wrote:
> On 05/11/2011 05:14, Richard Cornford wrote :
>> For some reason the biggest "gotcha" with javascript is premature
>> confidence. There seem to be recurrent manifestations of the
>> Dunning-Kruger effect (if you are not familiar with than look it
>> up as it is an interesting, and all too human, psychological
>> phenomenon).
>
><snip>
>
> I did not know about it, but I like it very much. I believe I have
> seen this many times (including in my own behavior), and will
> surely reuse that.
<snip>

Yes, the lesson from these psychological phenomenon is that they
follow from having psychology, so from being human. We must all suffer
from them, or at least be vulnerable to them, and the only defence is
to be aware their existence and their tendency to drive us into
fooling ourselves.  And then suspect our own positions and seek more
demonstrably objective justifications for them, or be willing to
abandon them in the face of not being able to find that objectivity.

>> Recently I had to write a technical test for some JS programmer
>> interview. I tried to include every common misconception about
>> javascript that I have noticed. These are (most of) the points
>> I tested for that bset qualify as "gotchas":-

><snip>
>
> This is an interesting idea. Experts usually judge a script by these
> very criteria, so formulating a test requiring an explicit usage of them
> by the candidate appears quite logical.

In this area the test was more a matter being able to recognise (and
explain) the issues rather than actually use them. I wanted a test
that would straddle the knowledge boundary that I was interested in.
That worked in the sense that all of the candidates got most of the
questions wrong (with more than 50% getting zero). The depressing part
was that one of my colleagues noticed that I had effectively given the
answer to an HTTP question in the example mark-up for a previous XHTML
question, I decided to leave it and see what happened, and none of the
candidates spotted the connection.

Richard.

[toc] | [prev] | [next] | [standalone]


#8130

FromScott Sauyet <scott.sauyet@gmail.com>
Date2011-11-08 05:23 -0800
Message-ID<ca845984-5fe3-406e-a55f-c4874cf770a6@r28g2000yqj.googlegroups.com>
In reply to#8126
Richard Cornford wrote:
> Elegie wrote
>> Richard Cornford wrote:
>>> [... re: the Dunning-Kruger effect ...]
>> I did not know about it, but I like it very much. I believe I have
>> seen this many times (including in my own behavior), and will
>> surely reuse that.
>
> Yes, the lesson from these psychological phenomenon is that they
> follow from having psychology, so from being human. We must all suffer
> from them, or at least be vulnerable to them, and the only defence is
> to be aware their existence and their tendency to drive us into
> fooling ourselves.

Well, the lesson is not that clear.  At least according to the
Wikipedia article [1], this is an American phenomenon, with a much
reduced effect for Europeans and a reversed version for Asians.  I
haven't read the original paper, but the fact that it won the Ig Nobel
Prize for psychology in 2000 gives me pause about lending it too much
credence.

  -- Scott

[1] http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

[toc] | [prev] | [next] | [standalone]


#8133

FromRichard Cornford <Richard@litotes.demon.co.uk>
Date2011-11-08 06:21 -0800
Message-ID<9c73662d-6ff6-473a-ad87-20d1f62b6088@l24g2000yqm.googlegroups.com>
In reply to#8130
On Nov 8, 1:23 pm, Scott Sauyet wrote:
> Richard Cornford wrote:
>> Elegie wrote
>>> Richard Cornford wrote:
>>>> [... re: the Dunning-Kruger effect ...]
>>> I did not know about it, but I like it very much. I believe I have
>>> seen this many times (including in my own behavior), and will
>>> surely reuse that.
>
>> Yes, the lesson from these psychological phenomenon is that they
>> follow from having psychology, so from being human. We must all
>> suffer from them, or at least be vulnerable to them, and the only
>> defence is to be aware their existence and their tendency to drive
>> us into fooling ourselves.
>
> Well, the lesson is not that clear.  At least according to the
> Wikipedia article [1], this is an American phenomenon, with a much
> reduced effect for Europeans and a reversed version for Asians.

Observing that there is a cultural bias in people's susceptibility to
a psychological phenomenon does not mean that any individual will
inevitably either be subject to it, or immune from it, due to their
cultural origin.

> I haven't read the original paper, but the fact that it won the
> Ig Nobel Prize for psychology in 2000 gives me pause about lending
> it too much credence.

Being awarded an Ig Nobel Prize does not, of itself, reflect on the
quality/validity of that research.

"The Ig Nobel Prizes honor achievements that first make people laugh,
and then make them think. The prizes are intended to celebrate the
unusual, honor the imaginative and spur people's interest in science,
medicine, and technology."

Richard.

[toc] | [prev] | [next] | [standalone]


#8146

FromGene Wirchenko <genew@ocis.net>
Date2011-11-08 14:49 -0800
Message-ID<sdcjb7l0epuidsjnv0gd2omiveqk3etlu1@4ax.com>
In reply to#8133
On Tue, 8 Nov 2011 06:21:50 -0800 (PST), Richard Cornford
<Richard@litotes.demon.co.uk> wrote:

[snip]

>Being awarded an Ig Nobel Prize does not, of itself, reflect on the
>quality/validity of that research.
>
>"The Ig Nobel Prizes honor achievements that first make people laugh,
>and then make them think. The prizes are intended to celebrate the
>unusual, honor the imaginative and spur people's interest in science,
>medicine, and technology."

      I have found the paper to have wonderful predictive value.  It
explains a lot of behaviour that I have run into.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#8168

FromScott Sauyet <scott.sauyet@gmail.com>
Date2011-11-09 05:10 -0800
Message-ID<95705491-65a9-4abe-be91-8f6b7a2a1ce8@n38g2000yqm.googlegroups.com>
In reply to#8133
Richard Cornford wrote:
> On Nov 8, 1:23 pm, Scott Sauyet wrote:
>> Richard Cornford wrote:
>>> Elegie wrote
>>>> Richard Cornford wrote:
>>>>> [... re: the Dunning-Kruger effect ...]
>>>> I did not know about it, but I like it very much. I believe I have
>>>> seen this many times (including in my own behavior), and will
>>>> surely reuse that.
>
>>> Yes, the lesson from these psychological phenomenon is that they
>>> follow from having psychology, so from being human. We must all
>>> suffer from them, or at least be vulnerable to them, and the only
>>> defence is to be aware their existence and their tendency to drive
>>> us into fooling ourselves.
>
>> Well, the lesson is not that clear.  At least according to the
>> Wikipedia article [1], this is an American phenomenon, with a much
>> reduced effect for Europeans and a reversed version for Asians.
>
> Observing that there is a cultural bias in people's susceptibility to
> a psychological phenomenon does not mean that any individual will
> inevitably either be subject to it, or immune from it, due to their
> cultural origin.

I was trying to suggest that this is not a phenomenon that follows
from being human (or "from having psychology"), but might be mostly a
cultural phenomenon.  I was not trying to reject your assertion that
we should be on guard against such tendencies in ourselves.  An
American myself, I recognize the behavior in myself and others.  I'm
just not so sure it's as universal as you seemed to imply.


>> I haven't read the original paper, but the fact that it won the
>> Ig Nobel Prize for psychology in 2000 gives me pause about lending
>> it too much credence.
>
> Being awarded an Ig Nobel Prize does not, of itself, reflect on the
> quality/validity of that research.

Of course not.  But looking at the company it keeps does make me
wonder a bit.  Most of the awards seem to have to do with either the
seeming triviality of the subject or with its blatant obviousness.  I
was suspecting the latter for this one, but (again, according to the
Wikipedia article) perhaps even that obviousness is a cultural
artifact.

  -- Scott

[toc] | [prev] | [next] | [standalone]


#8137

FromElegie <elegie@anonymous.invalid>
Date2011-11-08 19:14 +0100
Message-ID<4eb97183$0$26158$426a74cc@news.free.fr>
In reply to#8126
On 08/11/2011 12:33, Richard Cornford wrote :

Hi,

<snip>

>> This is an interesting idea. Experts usually judge a script by these
>> very criteria, so formulating a test requiring an explicit usage of them
>> by the candidate appears quite logical.
>
> In this area the test was more a matter being able to recognise (and
> explain) the issues rather than actually use them. I wanted a test
> that would straddle the knowledge boundary that I was interested in.
> That worked in the sense that all of the candidates got most of the
> questions wrong (with more than 50% getting zero). The depressing part
> was that one of my colleagues noticed that I had effectively given the
> answer to an HTTP question in the example mark-up for a previous XHTML
> question, I decided to leave it and see what happened, and none of the
> candidates spotted the connection.

I think that you need a drink :) It's too bad we don't live in the same 
country, I'd bought you one with pleasure.

<follows drink talk>

Can you imagine an accountant who takes one day to perform a closing, 
and another who takes a full month for that same closing? Well, in the 
IT industry, that seems to be the case. In the "Mythical Man-Month", 
Fred Brooks quoted a study which demonstrated that the skill level 
between two programmers could range from 1 to 10; and I was told later 
that the ratio was, nowadays, probably around 20 (I've got no study to 
back this, though).

Of course, this difference can be attributed to other factors than 
skill, such as creativity. Yet, this indicates that the industry is 
still young, that methods are not well known (or even not well thought), 
and that programmers are most often left on discovering good practices 
rather learning them.

Consequences of this are dangerous: programmers not only are slow to 
improve, but also believe "at all cost" in the knowledge they have 
gained, even if they're wrong - because there was pain in it. I 
currently believe that, even more than skills, it is attitude which 
should matter: strong analytical skills, intellectual honesty, 
curiosity, severity, ability to listen and comprehend, humility.

You know that I am no professional programmer (although I intend to 
change that soon), but I do have some knowledge. However, I happened to 
meet lots of professionals, and among them some "javascript experts". 
Well, imagine how happy I was to learn that state-of-the-art javascript 
now necessarily includes libraries which would use browser-detection, 
favor function overloading and for..in loops as array iterators, extend 
host and built-in objects (without even realizing that one should never 
extend an external API) or even override their implementation, adopting 
functional programming style at all cost...

To illustrate, I was recently told about that selector thing. I have not 
researched it, so I may be wrong, but my initial (and so far, sole) 
impression was not positive. Is the DOM API not flexible enough that it 
needs further abstraction? To me, it really felt like kids having fun 
building an interpreter (probably not even knowing what a token, a state 
or a continuation actually are), and being forced to eventually /use/ 
it, well, because it'd be too bad to not use it, once it's been written. 
(I'm probably unfair here.)

I see the path leading to expertise as follows:
- First, you're new to the technology, the code you write is pretty 
simple. You read books and specifications, and test every bit of it 
(trying obvious and not-so-obvious things). You're gradually reaching 
step 2.
- You write more complicated code. You're enjoying the language, which 
for javascript would translate as using loose-typing and reflective 
techniques more than you should, trying to transform the language into 
something you know (class-based inheritance, functional artifacts), 
imagining how design patterns apply to the language. You have someone 
read your code, he or she does not understand the least bit of it, 
you're happy, but think you'd be happier if they had understood it.
- There comes a point when you yourself do not understand even more what 
you have written. If you have some courage, you try and analyze it. Why 
so complicated? Gradually, you write code which is becoming simpler and 
simpler. Eventually, people reading your code will assess it as being 
"clean", "obvious", "short" and "natural". You're not back to step 1, 
but rather have reached elegance, i.e. you have understood the paradigm 
of the language, and made it so that the language looks like it was made 
for your program rather than the contrary.

Sorry for the rant! I believe that your story has reminded me of similar 
events, and of the feelings I had then (feelings which I believe you 
understand well).

Cheers,
Elegie.

[toc] | [prev] | [next] | [standalone]


#7982

FromErwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com>
Date2011-11-04 11:55 +0100
Message-ID<4eb3c4a4$0$6873$e4fe514c@news2.news.xs4all.nl>
In reply to#7976
On 11/4/2011 4:41 AM, Gene Wirchenko wrote:
> Hello:
>
>       The company that I work for is going for a Web-based frontend for
> its client billing system and to integrate the various company
> databases and applications.
>
>       The app will be internal for the projected future.  The browser
> will be IE 9, the OS Windows 7.  We will be using SQL Server Express
> for the DBMS.  For the Web end, it will be JavaScript, VBScript, ASP
> Classic, and AJAX.

Hello Gene,

A few warnings:

VBscript ASP classic?
Are you sure about that?
I maintain some old software I wrote many years ago which is written in 
classic VBscript on IIS, and it really hurts sometimes to wrap my mind 
around it. I never use VBscipt/classic ASP anymore for new projects (it 
has been like that for more than 10 years). Most developers won't use it 
for new projects (unless it is the only thing they know).

Seriously, consider using something better since you give the impression 
your company will develop it from the ground up anyway.

Also, make clear what you are doing serverside and clientside. In your 
posting you give me the impression you are not sure where what language 
runs exactly, but I might be wrong.
For example, both VBscript and JavaScript can run clientside and 
serverside. If you are going to use AJAX, you must understand the 
differences between serverside and clientside very well.
Especially if you are ever going to open up your webapp to the public: 
security matters.

And last: Are you sure you want to support IE9 on Win7 only?
Good webapps run on any browser. Just make sure you write your code 
sensible, and you support ALL BROWSERS worth mentioning.
I can't think of any valid reason to support only IE9 on Win7, unless 
you are knee-deep into ActiveX components running inside the browser.
(Don't do that if you can avoid it.)

>
>       I have some sample code, but have already found deficiencies with
> it.  I have dealt with some of the deficiencies (escape characters was
> a big one), but it has been a slow and arduous time.

Possibly.
In my experience it is easier to find poor scripts on the web than good 
ones.
And it is hard for newcomers to tell them apart. :-(


>
>       I have found that there are many basic guides on the Web, but all
> too few that get into the nasty bits.  For example, escape characters
> are not dealt by many pages, and I had to do a lot of hunting to find
> out what to do.

Do you have an example of that?
I am not sure I can follow.
Are you talking about escaping characters like ' " \?

>
>       I have read/skimmed the FAQ, and much of it is too high a level
> for me for now.

Yes, some topics are hard to grok (closures for example), but if you 
plan to move your application to your customers, you must have a certain 
understanding and do things right.
If you don't, your app will fail on other browsers or in circumstances 
you cannot envision right now.
You also have the serious possibility of making serious mistakes and 
create security holes.
If don't know what business you are in, or in which country you live, 
but opening up private information can have serious repercussions in 
certain countries. Please take care.


>
>       Are there any gotchas that I should be particularly alert for?

Yes. Too many to sum up here.

>
>       Are there any good books that get into the nasty bits?  (Of the
> two mnetioned in the FAQ, one does not seem appropriate.  The other
> one, I am not sure about.)

I learned my basics from the "Definitive Guide", second edition that was 
I think, don't use that now. ;-)
I think I learned more by lurking around in comp.lang.javascript.


>
>       You can read my questions as being about JavaScript specifically
> or the conglomerate of systems I mentioned.  I could use help with
> both.

To be honest: I think you should start studying a lot, or hire a 
competent developer.

Last tip:
Always feel free to ask questions in here.
Don't be scared to get spanked in the beginning.
1) Post your examplecode/problem in here as clear as you can.
Don't be afraid to ask stupid questions.
2) You WILL be corrected, also on thing you didn't ask about.
Take it all seriously, ignore some trolls, and you'll be good.


>
> Sincerely,
>
> Gene Wirchenko

Good luck.
Regards,
Erwin Moller


-- 
"That which can be asserted without evidence, can be dismissed without 
evidence."
-- Christopher Hitchens

[toc] | [prev] | [next] | [standalone]


#7993

FromGene Wirchenko <genew@ocis.net>
Date2011-11-04 09:54 -0700
Message-ID<6g58b79tuvv6tiepo803i3ndvkq75mbkhe@4ax.com>
In reply to#7982
On Fri, 04 Nov 2011 11:55:31 +0100, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> wrote:

>On 11/4/2011 4:41 AM, Gene Wirchenko wrote:
>> Hello:
>>
>>       The company that I work for is going for a Web-based frontend for
>> its client billing system and to integrate the various company
>> databases and applications.
>>
>>       The app will be internal for the projected future.  The browser
>> will be IE 9, the OS Windows 7.  We will be using SQL Server Express
>> for the DBMS.  For the Web end, it will be JavaScript, VBScript, ASP
>> Classic, and AJAX.

>A few warnings:
>
>VBscript ASP classic?
>Are you sure about that?

     That is what has been selected.

>I maintain some old software I wrote many years ago which is written in 
>classic VBscript on IIS, and it really hurts sometimes to wrap my mind 
>around it. I never use VBscipt/classic ASP anymore for new projects (it 
>has been like that for more than 10 years). Most developers won't use it 
>for new projects (unless it is the only thing they know).
>
>Seriously, consider using something better since you give the impression 
>your company will develop it from the ground up anyway.

     Your impression is correct.

>Also, make clear what you are doing serverside and clientside. In your 
>posting you give me the impression you are not sure where what language 
>runs exactly, but I might be wrong.
>For example, both VBscript and JavaScript can run clientside and 
>serverside. If you are going to use AJAX, you must understand the 
>differences between serverside and clientside very well.

     It will be JavaScript on the client side and VBScript on the
server side.

>Especially if you are ever going to open up your webapp to the public: 
>security matters.

     I have been considering that.

>And last: Are you sure you want to support IE9 on Win7 only?
>Good webapps run on any browser. Just make sure you write your code 
>sensible, and you support ALL BROWSERS worth mentioning.
>I can't think of any valid reason to support only IE9 on Win7, unless 
>you are knee-deep into ActiveX components running inside the browser.
>(Don't do that if you can avoid it.)

     I know your arguments.  This is to be an internal app, and we can
enforce the platform.  Later, we may expand it.  It is more important
to get the app going first.  I do not plan to write to IE9/Win7, but I
am not going to worry about breaking a different combo FOR NOW.
Personally, I prefer Firefox.

>>       I have some sample code, but have already found deficiencies with
>> it.  I have dealt with some of the deficiencies (escape characters was
>> a big one), but it has been a slow and arduous time.
>
>Possibly.
>In my experience it is easier to find poor scripts on the web than good 
>ones.
>And it is hard for newcomers to tell them apart. :-(

     Code that will not properly handle values with single quotes or
ampersands are easy for this newcomer to detect.  I have a solution to
this.  I do not know that it is complete w.r.t. weird characters.

>>       I have found that there are many basic guides on the Web, but all
>> too few that get into the nasty bits.  For example, escape characters
>> are not dealt by many pages, and I had to do a lot of hunting to find
>> out what to do.
>
>Do you have an example of that?
>I am not sure I can follow.
>Are you talking about escaping characters like ' " \?

     That was one.

>>       I have read/skimmed the FAQ, and much of it is too high a level
>> for me for now.
>
>Yes, some topics are hard to grok (closures for example), but if you 
>plan to move your application to your customers, you must have a certain 
>understanding and do things right.
>If you don't, your app will fail on other browsers or in circumstances 
>you cannot envision right now.
>You also have the serious possibility of making serious mistakes and 
>create security holes.
>If don't know what business you are in, or in which country you live, 
>but opening up private information can have serious repercussions in 
>certain countries. Please take care.

     I plan to.  This is an internal app though.

>>       Are there any gotchas that I should be particularly alert for?
>
>Yes. Too many to sum up here.

     Can you give me some specifics?  Even a checklist of "Not that,
you fool!" would help.

>>       Are there any good books that get into the nasty bits?  (Of the
>> two mnetioned in the FAQ, one does not seem appropriate.  The other
>> one, I am not sure about.)
>
>I learned my basics from the "Definitive Guide", second edition that was 
>I think, don't use that now. ;-)

     That is the one I am not sure about.  I will have to hunt down
some reviews.  The FAQ has little.

>I think I learned more by lurking around in comp.lang.javascript.

     Yup.  Did you know that there have been over 6,000 posts to this
newsgroup in the past two years?  (Sorry, but that counts the nude
spams.)

>>       You can read my questions as being about JavaScript specifically
>> or the conglomerate of systems I mentioned.  I could use help with
>> both.
>
>To be honest: I think you should start studying a lot, or hire a 
>competent developer.

     I am trying to study.  As I mentioned earlier, there is a lot of
very basics, but not so much of the stuff needed to really make a
solid system.

>Last tip:
>Always feel free to ask questions in here.
>Don't be scared to get spanked in the beginning.
>1) Post your examplecode/problem in here as clear as you can.
>Don't be afraid to ask stupid questions.
>2) You WILL be corrected, also on thing you didn't ask about.
>Take it all seriously, ignore some trolls, and you'll be good.

     Standard, good USENET advice.

     Thank you for your post.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#8018

FromElegie <elegie@anonymous.invalid>
Date2011-11-04 22:45 +0100
Message-ID<4eb45ce8$0$10051$426a74cc@news.free.fr>
In reply to#7976
On 04/11/2011 04:41, Gene Wirchenko wrote :

Hi,

>       The app will be internal for the projected future.  The browser
> will be IE 9, the OS Windows 7.  We will be using SQL Server Express
> for the DBMS.  For the Web end, it will be JavaScript, VBScript, ASP
> Classic, and AJAX.

Others have already commented on that choice. Note that you can also use 
ASP with JScript (this way you'd just have to learn one language instead 
of two, unless you already know VBScript).

I used to do some ASP 3.0 about 10 years ago. I liked it very much, it 
was very easy, yet be careful about your design: it's all too easy, with 
ASP, to have your application layers interwoven (thus making your 
application incredibly difficult to extend).

>       Are there any good books that get into the nasty bits?  (Of the
> two mnetioned in the FAQ, one does not seem appropriate.  The other
> one, I am not sure about.)

I don't know about books, but can tell you about my learning javascript. 
It all began in 1999, I started with some big book about HTML/Javascript 
(this gave me a feeling about the technology), then I started 
participating on comp.lang.javascript. I soon identified posters whose 
discussions and scripts looked interesting, and read all their past 
posts. While doing so, I also read the specifications, and made some 
test cases each time I encountered something new. In about 3 years, I 
was pretty confident in my skills.

Authors I especially liked reading were Martin Honnen (I have never seen 
this guy make a mistake), Jim Ley and Gosha Bine (the stereofrog), and a 
few years later, Richard Cornford (who made decisive contributions to 
the global understanding of the nature of javascript).

HTH,
Elegie.

[toc] | [prev] | [next] | [standalone]


#8032

FromSean Kinsey <okinsey@gmail.com>
Date2011-11-05 04:07 -0700
Message-ID<27506233.170.1320491249895.JavaMail.geo-discussion-forums@prmv24>
In reply to#7976
Really? ASP? In 2011? 
Abstract this, and go for ASP.NET AJAX or WCF - it will solve _all_your potential problems with escaping and so forth. 
To continue; it will even provide you with ready made Javascript proxy methods so that you can call any method as if they were local (although async).

If your management object to bringing in a 'new' technology - then tell them that it will be worth it (and I do know what I'm talking about).

Seriously, if they're in SF, let me now and I'll stop by and call them stupid.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web