• jevakallio 2 months ago

    I love the annotated source code, but I wouldn't necessarily recommend the Underscore library code itself as learning material to budding developers - it's optimised for size and performance, not legibility and idiomatic style. I remember being a budding JS dev once upon a time, and being quite perplexed by it :)

  • jashkenas 2 months ago

    I quite agree that it's grown a bit gnarled and tangled with optimizations over the years.

    It's interesting to compare the current version to the earliest available copy of the annotated source code, from version 1.1.1, seven years ago, in a simpler JavaScript age:

    https://cdn.rawgit.com/jashkenas/underscore/1.1.1/docs/under...

  • mzzter 2 months ago

    I've learned a lot from reading your underscore.js source code.

    For me, I started by reading and understanding the raw commented source code from the first release (without the initialization wrapper and initially confusing module setup): http://cdn.rawgit.com/jashkenas/underscore/f4299d7427abc59bc...

    Then I had an easier time following the annotated version after understanding how the other functions were built on top of each other in the simpler syntax.

  • bootcat 2 months ago

    Wow, time flies and things get better with revision usually,

  • KomradeKeeks 2 months ago

    Would you happened to recall what projects/Etudes help you develop your programming skills? Asking for a friend

  • armandososa 2 months ago

    Also interesting, even if it has become unfashionable these days, Backbone's annotated source: http://backbonejs.org/docs/backbone.html

    And the tool to make these: http://ashkenas.com/docco/

  • bootcat 2 months ago

    Amazing, to know about docco !!

  • pvsukale3 2 months ago

    For beginners annotated code of highly optimized library might become confusing. Try reading Mary Rose Cook's annotated code of 2 JS games and a Git clone http://annotated-code.maryrosecook.com/

  • teh_klev 2 months ago

    Probably a bit long in the tooth now:

    http://robflaherty.github.io/jquery-annotated-source/

  • schemathings 2 months ago

    Line 6: Naked function reference for surrogate-prototype-swapping. var Ctor = function(){};

    TIL Ctor is short for constructor (?)

  • hacktothefuture 2 months ago

    Very nice! Even those of us who don't consider ourselves "budding" have plenty to learn here.

  • bootcat 2 months ago

    Feel the same !

  • p51ngh 2 months ago

    How did you go about creating this? I think it's super useful way of documenting code in general!

  • jevakallio 2 months ago

    It's written with Docco, a tool created by Jeremy Ashkenas. It's used in docs of his other projects, such as CoffeeScript and Backbone, too.

    http://ashkenas.com/docco/

  • bootcat 2 months ago

    Look at docco comment above ! Just learnt myself !

  • magic_beans 2 months ago

    This is amazingly helpful. Thank you for posting!