Prototype - Good/Bad/Why?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Cornford

    #46
    Re: Prototype - Good/Bad/Why?

    David Mark wrote:
    <snip>
    Crockford is one of the leading experts on JavaScript.
    Other than Richard Cornford, I am not familiar with
    any bigger authorities on the language.
    <snip>

    Martin Honnen? For experience and technical knowledge Martin is pretty had
    to beat.

    As worded that has the implication that I may be bigger authority on
    javascript than Douglas Crockford. I am not very comfortable with that idea.
    Partly because I am not very comfortable with the idea of authority at all;
    nobody's ideas are worth any more, or any less, than the reasoning behind
    them. But mostly because Douglas Crockford was genuinely an expert when I
    was a complete novice and making all the amateurish mistakes that are
    expected of novices.

    I learnt a huge amount from Douglas Crockford as a result of our exchanges
    on this group, and even more as a direct result of reading his articles and
    code. It is the case, for example, that I maybe would never have pursued
    closures were it not for Douglas Crockford's method for creating private
    members of javascript object instances (because that more OO employment of
    closures had more concrete appeal at the time for a former Java programmer
    than Yann-Erwan Perio's fascinating functional programming examples).

    It is difficult to understate the significance of JSON. Javascript's object
    notation sat under our noses for years but it took a genius to notice that a
    subset of it could be directly interchangeable with XML but more efficient,
    and that genius was Douglas Crockford. JSON is here to stay, and if
    inventing it were his only legacy that alone would be a significant
    accolade. But if you look at every significant change in the way javascript
    is coded that has happened over the last half decade or so a line of
    influences traced back might branch and spider along the way but sooner or
    later it would link to Douglas Crockford.

    Richard.


    Comment

    • David Mark

      #47
      Re: Prototype - Good/Bad/Why?

      On Feb 19, 8:31 pm, "Richard Cornford" <Rich...@litote s.demon.co.uk>
      wrote:
      David Mark wrote:
      >
      <snip>Crockfo rd is one of the leading experts on JavaScript.
      Other than Richard Cornford, I am not familiar with
      any bigger authorities on the language.
      >
      <snip>
      >
      Martin Honnen? For experience and technical knowledge Martin is pretty had
      to beat.
      Yes, he always seems to know what he is talking about. And how could
      I have left out Jim Ley? Then again, perhaps he is more known for
      cross-browser scripting expertise (like PPK.) He got me off browser
      sniffing many years back (yes, I once thought the user agent string
      was source of relevant information.) What ever happened to him?
      >
      As worded that has the implication that I may be bigger authority on
      javascript than Douglas Crockford. I am not very comfortable with that idea.
      I didn't really mean to imply that. But isn't his famed "module
      pattern" something you came up with first?
      Partly because I am not very comfortable with the idea of authority at all;
      nobody's ideas are worth any more, or any less, than the reasoning behind
      them. But mostly because Douglas Crockford was genuinely an expert when I
      was a complete novice and making all the amateurish mistakes that are
      expected of novices.
      >
      I learnt a huge amount from Douglas Crockford as a result of our exchanges
      on this group, and even more as a direct result of reading his articles and
      code. It is the case, for example, that I maybe would never have pursued
      closures were it not for Douglas Crockford's method for creating private
      members of javascript object instances (because that more OO employment of
      closures had more concrete appeal at the time for a former Java programmer
      than Yann-Erwan Perio's fascinating functional programming examples).
      I had barely heard of them a year or so back. It was your article on
      the subject that changed the way I write script. The various demos on
      your site are what led me to use one-off feature detection/testing. I
      don't know how I got by for so many years without that pattern. It
      goes to show that it doesn't take a lifetime to learn advanced browser
      scripting techniques if you choose the examples you follow carefully.
      On the other hand, there are so many poor sources of information on
      JavaScript out there that it is very easy to get lost forever.
      >
      It is difficult to understate the significance of JSON. Javascript's object
      notation sat under our noses for years but it took a genius to notice thata
      subset of it could be directly interchangeable with XML but more efficient,
      and that genius was Douglas Crockford. JSON is here to stay, and if
      inventing it were his only legacy that alone would be a significant
      accolade. But if you look at every significant change in the way javascript
      is coded that has happened over the last half decade or so a line of
      influences traced back might branch and spider along the way but sooner or
      later it would link to Douglas Crockford.
      >
      I imagine so. I use one of his programs (JSLint) to "supervise" my
      own code. It is quite humbling when somebody else's *code* knows more
      about JavaScript than you do! Lately it only catches typos, but there
      was a time when it would inform me of all sorts of issues that I was
      otherwise unaware of. If I ran some of my 90's code through it, it
      would probably tell me to find a new career.

      Comment

      • Randy Webb

        #48
        Re: Prototype - Good/Bad/Why?

        David Mark said the following on 2/19/2008 9:50 PM:
        On Feb 19, 8:31 pm, "Richard Cornford" <Rich...@litote s.demon.co.uk>
        wrote:
        >David Mark wrote:
        >>
        ><snip>Crockfor d is one of the leading experts on JavaScript.
        >>Other than Richard Cornford, I am not familiar with
        >>any bigger authorities on the language.
        ><snip>
        >>
        >Martin Honnen? For experience and technical knowledge Martin is pretty had
        >to beat.
        >
        Yes, he always seems to know what he is talking about. And how could
        I have left out Jim Ley? Then again, perhaps he is more known for
        cross-browser scripting expertise (like PPK.) He got me off browser
        sniffing many years back (yes, I once thought the user agent string
        was source of relevant information.) What ever happened to him?
        He (Jim) is still around, you just don't see him much anymore.

        --
        Randy
        Chance Favors The Prepared Mind
        comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
        Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

        Comment

        • Arnaud Diederen

          #49
          Re: Prototype - Good/Bad/Why?

          David Mark <dmark.cinsoft@ gmail.comwrites :
          >
          Crockford is one of the leading experts on JavaScript. Other than
          Richard Cornford, I am not familiar with any bigger authorities on the
          language.
          >
          In my early JavaScript coding days, I found out about Matt Kruse's
          Knowledge Database
          <URL: http://www.javascriptt oolbox.com/search/>, which is
          basically just a re-dispatch of queries to google "web" and google
          groups.

          I spotted the "trusted" names on the query in the lower frame
          (type, for example -niark niark- "Prototype. js" in the input field, to
          perform a query) and raised their score in my Gnus client.

          The posts of those people turned out to be, at least, most reliable!

          Best,
          A.

          Comment

          • Randy Webb

            #50
            Re: Prototype - Good/Bad/Why?

            Arnaud Diederen (aundro) said the following on 2/20/2008 5:40 AM:
            David Mark <dmark.cinsoft@ gmail.comwrites :
            >Crockford is one of the leading experts on JavaScript. Other than
            >Richard Cornford, I am not familiar with any bigger authorities on the
            >language.
            >>
            >
            In my early JavaScript coding days, I found out about Matt Kruse's
            Knowledge Database
            <URL: http://www.javascriptt oolbox.com/search/>, which is
            basically just a re-dispatch of queries to google "web" and google
            groups.
            >
            I spotted the "trusted" names on the query in the lower frame
            (type, for example -niark niark- "Prototype. js" in the input field, to
            perform a query) and raised their score in my Gnus client.
            >
            The posts of those people turned out to be, at least, most reliable!
            Matt, if you are reading this, a search on that page for the simple
            phrase "prototype. js" turns up zero hits in Usenet. It should find at
            least some as I know that I have used prototype.js in posts as an
            author. If I do a manual search in Google Groups for it, then I find it.

            Phrase: prototype.js
            Group: comp.lang.javas cript
            Author: Randy Webb

            Your site gives me zero hits, a manual search gives me 88 results.

            --
            Randy
            Chance Favors The Prepared Mind
            comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
            Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

            Comment

            • Matt Kruse

              #51
              Re: Prototype - Good/Bad/Why?

              On Feb 20, 1:42 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
              Matt, if you are reading this, a search on that page for the simple
              phrase "prototype. js" turns up zero hits in Usenet.
              Yeah, I did the same test, having forgotten that the page even
              existed.

              I'll take a look at it and try to fix it at some point.

              Matt

              Comment

              • Tony

                #52
                Re: Prototype - Good/Bad/Why?

                On Feb 19, 12:34 pm, timothytoe <timothy...@gma il.comwrote:
                Don't think that there are not people learning as a result of this
                discussion. I, for one, am very interested, as I'm close to hiring a
                couple JavaScript programmers and I have to figure out the lay of the
                land. Years ago I was on the employee side of the equation. Now I'm on
                the boss side and I want to make sure I don't get blindsided. I am
                using jQuery for a mock-up, and I have to figure out where to go from
                there when I hire. I'm glad I chose it, because using it lets me
                proceed fast enough to get up and running. Having a demo come up do
                speed quickly makes a big difference in getting projects moving ($$$).
                I would be very interested in speaking with you outside this group. As
                your profile says emailing you may not work, would you please email
                me?

                Comment

                • Richard Cornford

                  #53
                  Re: Prototype - Good/Bad/Why?

                  On Feb 20, 2:50 am, David Mark wrote:
                  On Feb 19, 8:31 pm, Richard Cornford wrote:
                  >David Mark wrote:
                  <snip>
                  >>Crockford is one of the leading experts on JavaScript.
                  >>Other than Richard Cornford, I am not familiar with
                  >>any bigger authorities on the language.
                  >
                  ><snip>
                  >
                  >Martin Honnen? For experience and technical knowledge Martin is pretty
                  had
                  >to beat.
                  >
                  Yes, he always seems to know what he is talking about.
                  Yes, these days if Martin gets a single technical correction here he is
                  having a bad year.
                  And how could I have left out Jim Ley?
                  That is what I thought just after I switched of the computer to go to bed.
                  Then again, perhaps he is more known for
                  cross-browser scripting expertise
                  Yes, in the long rung Jim Ley's influence on browser scripting practices may
                  be as great as Douglas Crockford's influence of javascript code authoring.
                  But that will be after User Agent string browser sniffing had disappeared
                  for good, and unfortunately recent trends have been in the wrong direction.
                  (like PPK.)
                  YMMV
                  He got me off browser sniffing many years back (yes, I once
                  thought the user agent string was source of relevant information.)
                  Likewise, though I don't think I ever thought of the user agent string as
                  "relevant information". More like I had seen it used in/on books/websites,
                  had never seen any alternative and hadn't really thought about it at all
                  beyond that.
                  What ever happened to him?
                  Jim is apparently working for an outfit called Joost who do video/television
                  distribution over the Internet.
                  >As worded that has the implication that I may be bigger authority on
                  >javascript than Douglas Crockford. I am not very comfortable with
                  >that idea.
                  >
                  I didn't really mean to imply that. But isn't his famed "module
                  pattern" something you came up with first?
                  Yes, which puts me in a very good position to make informed statements about
                  the chains of influences the lead up to in.

                  <snip>
                  >... . It is the case, for example, that I maybe would never have
                  >pursued closures were it not for Douglas Crockford's method for
                  >creating private members of javascript object instances (because
                  >that more OO employment of closures had more concrete appeal at
                  >the time for a former Java programmer than Yann-Erwan Perio's
                  >fascinating functional programming examples).
                  >
                  I had barely heard of them a year or so back. It was your article
                  on the subject that changed the way I write script.
                  <snip>

                  In the four years since that article was written closures have become
                  mainstream in javascript. To the point were it would be difficult to take a
                  javascript "expert" seriously if they did not have at least a practical
                  understanding of closures. And you would be hard pressed to find any sizable
                  body of recently written javascript code that does not use closures. So if
                  my article is instrumental in spreading an understanding of javascript's
                  closures that eventually alters the way serious javascript is written then
                  the influences behind the article also become the influences behind the
                  changes.

                  Richard.


                  Comment

                  • Peter Michaux

                    #54
                    Re: Prototype - Good/Bad/Why?

                    On Feb 20, 2:29 pm, "Richard Cornford" <Rich...@litote s.demon.co.uk>
                    wrote:
                    Yes, in the long rung Jim Ley's influence on browser scripting practices may
                    I don't know what I've read that was written by Jim himself. Are there
                    any particular articles?
                    be as great as Douglas Crockford's influence of javascript code authoring.
                    But that will be after User Agent string browser sniffing had disappeared
                    for good, and unfortunately recent trends have been in the wrong direction.
                    Are you sure they are heading in the wrong direction? I don't think
                    that is really the case. The libraries do slowly remove sniffs when
                    learn about a better way. I think that many programmers want to do the
                    right thing but don't know how to do it.

                    I've gathered information about feature detection and cross-browser
                    scripts from members of this group over the past couple years. The
                    knowledge here is the best available on the Internet but I think it is
                    true that the responses to questions can sometimes be too blunt and/or
                    rude. I survived this abuse and appreciate being given straight
                    answers. But imagine a person who is interested in learning something
                    new but is slightly insecure about being seen making mistakes. I think
                    just one response on c.l.js may send them running. This is a shame
                    because they loose out, others loose out by hearing c.l.js is a bunch
                    of trolls and the browser scripting profession doesn't benefit from
                    the group. To a certain degree the group's behavior impedes one
                    apparent goal of improving the over all standard of browser scripting.
                    It doesn't mean people with bad code need to be congratulated but they
                    don't need to read responses about how stupid they are etc.

                    I'm attempting to leak some of the information I've gathered from the
                    group about browser scripting to the "outside world". I've posted a
                    couple articles on my blog and hope they have a decent number of
                    visitors. More articles will help spread the word. Not everyone is
                    going to come here for the information.

                    Peter

                    Comment

                    • Matt Kruse

                      #55
                      Re: Prototype - Good/Bad/Why?

                      On Feb 20, 4:29 pm, "Richard Cornford" <Rich...@litote s.demon.co.uk>
                      wrote:
                      True, to some extent. I've run into problems a number of times where
                      the jquery approach of finding elements and attaching event listeners
                      on page load is extremely inefficient and slow. Simple solution is to
                      delegate the event to a common container and a single event listener.
                      You are describing a situation where jquery's performance is constraining
                      what is possible in the rest of the system. I would say that was a
                      performance issue, just not an insurmountable one in your case.
                      To be fair, though, I'm not sure it's jQuery's fault as much as the
                      fault of the "unobtrusiv e" strategy of applying scripted behavior to
                      an unscripted page once the DOM is loaded. In most cases this has
                      worked well for me, but in some cases it's just not practical. Since I
                      work primarily on internal web apps, I've also often resorted to using
                      inline event handlers, etc. Depending on the situation, different
                      solutions speed up IE's rendering speed considerably.

                      The problem with event delegation to a common container is that
                      objects can cancel the bubble. If you aren't in control of all parts
                      of the page, you never know what might prevent the event from reaching
                      your container. If IE would support event capturing my life would be
                      easier...
                      Just one browser? So that would be Windows IE then.
                      Most of the time, yes.
                      You work on a single browser Intranet but the browser is only IE most of the
                      time?
                      I don't work on an Intranet. I typically work on web applications
                      (whether internet or intranet, but behind a login) used by small
                      groups having a single standard web browser. Most of the time this is
                      IE. It has also been FF at times.
                      That explains why don't have performance issues - the Intranet is
                      running on quantum computers so the web browser has become subject to the
                      Hinesburg uncertainty principle; it only becomes IE when someone is
                      observing it to be IE.
                      Schroedinger's Browser, perhaps? You can test all browsers
                      simultaneously until you turn on your monitor and observe it ;)

                      Matt Kruse

                      Comment

                      • Peter Michaux

                        #56
                        Re: Prototype - Good/Bad/Why?

                        On Feb 20, 7:54 pm, Matt Kruse <m...@mattkruse .comwrote:
                        The problem with event delegation to a common container is that
                        objects can cancel the bubble. If you aren't in control of all parts
                        of the page, you never know what might prevent the event from reaching
                        your container.
                        That is certainly a problem. Cancel bubble is not necessary and
                        shouldn't be used for exactly this reason. Even if you are in control
                        of the entire page you may want to add an unrelated delegate listener
                        to do something like log "hot spots" where a user interacts with the
                        page. If you've relied on cancel bubble in this case then parts of
                        JavaScript will need to be rewritten.
                        If IE would support event capturing my life would be easier...
                        Wouldn't it just.

                        Peter

                        Comment

                        • Eric B. Bednarz

                          #57
                          Re: Prototype - Good/Bad/Why?

                          Richard Cornford <Richard.Cornfo rd@googlemail.c omwrites:

                          [about: "Since valid HTML is simply a subset of XML, …]
                          It is not errata, the intention is humorous.
                          You are not telling us that the original text was *not* intended to be
                          humorous, are you? :)

                          --
                          ‘Luckily, there exists an excellent resource for explaining how closures
                          work in Javascript: “JavaScript Closures” by Jim Ley at

                          (Resig, Pro JavaScriptâ„¢ Techniques, 30)

                          Comment

                          Working...