+1 As well, I think its easier to read.

-Ryan

Email: [email protected]
Phone: 978-899-3041
developerWorks Profile



From:   Dan Dumont/Westford/IBM@Lotus
To:     [email protected], 
Date:   07/26/2011 09:00 AM
Subject:        Re: javascript readability..



+1



From:   Paul Lindner <[email protected]>
To:     [email protected], 
Date:   07/26/2011 02:51 AM
Subject:        javascript readability..



Hi,

I'm curious to know what people think about some of the idioms in the JS
code you find in shindig.  There's an awful lot of stuff like this:

shindig.foo = function(){
  //...
  var myFunction = function() {
     }

  return {'foo': myFunction,
            'bar': function() {
               return 'bar';
            }};
}();


Just search for @member to see the various places.

What would people think if we moved to fully defined names for
function/method definitions instead?

You could still wrap this inside a closure if you wanted local scope:

function() {
  shindig.foo.foo = function() {
     ...
  }
  shindig.foo.bar = function() {
     ...
  }
}();

-- 
Paul Lindner -- [email protected] -- linkedin.com/in/plindner






Reply via email to