I tend to think that js is a horrible language if you are coming from the
structured, neat world of python.

CoffeeScript fixes this problem.
On Feb 21, 2012 5:33 PM, "Zoom.Quiet" <[email protected]> wrote:

> 2012/2/21 Edward K. Ream <[email protected]>:
> > I've got to learn javascript in order to read the MooTools sources :-)
> >
>
> - life with leanning, forever ;-)
> - for javascript
>    - if for Ajax, jQuery is funny and feel good than mootools
>    - for web dev. node.js is power with coffeescript ;-)
>    and js is realy beautyful lang. with some ugly design:
>        - maybe this is the reason to make people creat sooooo many
> crzy tools for js dev.
> ps:
> suggest some goo words abt js:
>    JavaScript: The World's Most Misunderstood Programming Language
>        http://javascript.crockford.com/javascript.html
>    Web 2.0 Development and Business Lessons: You Don't Know JavaScript
>        http://www.w2lessons.com/2011/04/you-dont-know-javascript.html
>
> > Some first steps.
> >
> > The MooTools sources are minimized, but not obfuscated.  Googling for
> > "reformat JavaScript" took me to:
> >
> > http://jsbeautifier.org/
> >
> > I imported the result into Leo.  The importer needs more than a tad of
> > work, but I was impatient, so I reformatted by hand.
> >
> > Semicolons confused me, so I googled "javascript semicolon".:
> >
> > http://mislav.uniqpath.com/2010/05/semicolons/
> >
> > So now some confusion has been eliminated.
> >
> > From within the above article, I found a link to "the module pattern",
> >
> > http://www.yuiblog.com/blog/2007/06/12/module-pattern/
> >
> > Here is an important excerpt:
> >
> > QQQ
> > 2. Assign the return value of an anonymous function to your namespace
> > object:
> >
> > YAHOO.myProject.myModule = function () {
> >
> >        return  {
> >                myPublicProperty: "I'm accessible as
> > YAHOO.myProject.myModule.myPublicProperty.",
> >                myPublicMethod: function () {
> >                        YAHOO.log("I'm accessible as
> > YAHOO.myProject.myModule.myPublicMethod.");
> >                }
> >        };
> >
> > }(); // the parens here cause the anonymous function to execute and
> > return
> >
> > Note the very last line with the closing curly brace and then the
> > parentheses (). This notation causes the anonymous function to execute
> > immediately, returning the object containing myPublicProperty and
> > myPublicMethod. As soon as the anonymous function returns, that
> > returned object is addressable as YAHOO.myProject.myModule.
> > QQQ
> >
> > Ah.  Now I understand why the function can have no name, what similar
> > code is doing, and why it *might* be a good idea to end the last line
> > with a semicolon ;-)
> >
> > I'm still amazed that anyone can write software with a language like
> > this, but now I have an inkling about how it might happen.
> >
> > Edward
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "leo-editor" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected].
> > For more options, visit this group at
> http://groups.google.com/group/leo-editor?hl=en.
> >
>
>
>
> --
> 人生苦短, Pythonic! 冗余不做,日子甭过!备份不做,十恶不赦!
> 俺: http://about.me/zoom.quiet
> 文字协议: http://creativecommons.org/licenses/by-sa/2.5/cn/
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/leo-editor?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to