Live data from Hacker News

John Resig annotates original jQuery source code

genius.com

41–50 of 102 posts

Re: John Resig annotates original jQuery source code

#41
post #2

Very neat content, but does it have to be formatted like this? I respect that it preserves the original file, but it makes it very difficult to read. Comments added to the source code would serve much better for the purposes of understanding the code. This tool makes it impossible to read the annotation and the source code at the same time. Clicking on 'set' for example, about 20-30 lines in, lets you read the annota…

It would be nice if you could simply drag the modal once it's rendered. I think that would be the most simple solution.

Re: John Resig annotates original jQuery source code

#42

Though Resig's anecdotes are fun and interesting to read, it doesn't help that much with understanding the actual source code. Here's a better version in terms of readability and depth: https://robflaherty.github.io/jquery-annotated-source/ https://robflaherty.github.io/jquery-annotated-source/docs/0... Sadly, no longer updated since jQuery 1.6.2 which was released in 2011.

Out of curiosity, do you know of any other ubiquitous projects that have had a similar treatment?

CoffeeScript's source is annotated in the same way.

Re: John Resig annotates original jQuery source code

#43

Though Resig's anecdotes are fun and interesting to read, it doesn't help that much with understanding the actual source code. Here's a better version in terms of readability and depth: https://robflaherty.github.io/jquery-annotated-source/ https://robflaherty.github.io/jquery-annotated-source/docs/0... Sadly, no longer updated since jQuery 1.6.2 which was released in 2011.

The comments in the current jQuery source are pretty good about explaining the strange things that need to be done to work around bugs in browsers. Look for the `// Supports:` comments.

Re: John Resig annotates original jQuery source code

#44
post #13
post #2

Very neat content, but does it have to be formatted like this? I respect that it preserves the original file, but it makes it very difficult to read. Comments added to the source code would serve much better for the purposes of understanding the code. This tool makes it impossible to read the annotation and the source code at the same time. Clicking on 'set' for example, about 20-30 lines in, lets you read the annota…

This formatting style for annotated sources always seems to work so well: http://robflaherty.github.io/jquery-annotated-source/docs/01...

What is the tool that produces this?

Re: John Resig annotates original jQuery source code

#45
post #13

Earlier quoted context omitted.

This formatting style for annotated sources always seems to work so well: http://robflaherty.github.io/jquery-annotated-source/docs/01...

What is the tool that produces this?

The Docco ( http://jashkenas.github.io/docco/ ) family of tools.

Re: John Resig annotates original jQuery source code

#46
post #13
post #2

Very neat content, but does it have to be formatted like this? I respect that it preserves the original file, but it makes it very difficult to read. Comments added to the source code would serve much better for the purposes of understanding the code. This tool makes it impossible to read the annotation and the source code at the same time. Clicking on 'set' for example, about 20-30 lines in, lets you read the annota…

This formatting style for annotated sources always seems to work so well: http://robflaherty.github.io/jquery-annotated-source/docs/01...

I think this wouldn't work for anecdotal comments that John is doing here which runs into paragraphs which would result in lot of whitespace on the right. I think an easier fix would be to highlight the current annotation in a different color while docking the comments to the right while keeping it free for user to move around.

I agree that clicking to go to next is annoying. Perhaps mouse over or scrolling should automatically show the annotation.

Re: John Resig annotates original jQuery source code

#48
post #7
post #2

Very neat content, but does it have to be formatted like this? I respect that it preserves the original file, but it makes it very difficult to read. Comments added to the source code would serve much better for the purposes of understanding the code. This tool makes it impossible to read the annotation and the source code at the same time. Clicking on 'set' for example, about 20-30 lines in, lets you read the annota…

I like it. It almost makes me wish I could comment my code like this somehow. I often find that long comments can break my flow when reading code -- but of course, commenting is necessary, so perhaps it could be useful to pull them aside in an IDE. Does something like that exist?

There is something that I have been working on:

https://vimeo.com/97711978#t=0m37s

Re: John Resig annotates original jQuery source code

#49
post #8

I would actually like this in an IDE. Visual Studio kind of does this with header comments but it would be great to be able to show/hide comments with links, rich text,...

Kind of surprised Sublime Text 2 / 3 doesn't have a plugin that allows for annotation.
Post reply on HN