Live data from Hacker News

Annotated code: Circles bouncing off lines

annotated-code.maryrosecook.com

21–30 of 70 posts

Re: Annotated code: Circles bouncing off lines

#21
I hate this left/right code documentation fad with passion.

Making my eyes jump horizontally across the page every few lines is about the worst you can possibly do for readability.

Just keep the damn comments inline and use colors/font-faces/fold markers to make it readable.

Re: Annotated code: Circles bouncing off lines

#22
post #21

I hate this left/right code documentation fad with passion. Making my eyes jump horizontally across the page every few lines is about the worst you can possibly do for readability. Just keep the damn comments inline and use colors/font-faces/fold markers to make it readable.

Do you also prefer footnotes and sidebars inline when reading articles?

These are standard typographical practices. I do set my comment color to super light so comments don't distract me too much when reading code, but I wish there was a better way.

Re: Annotated code: Circles bouncing off lines

#23
post #21

I hate this left/right code documentation fad with passion. Making my eyes jump horizontally across the page every few lines is about the worst you can possibly do for readability. Just keep the damn comments inline and use colors/font-faces/fold markers to make it readable.

Do you also prefer footnotes and sidebars inline when reading articles? These are standard typographical practices. I do set my comment color to super light so comments don't distract me too much when reading code, but I wish there was a better way.

How about toggle-able comments?

Re: Annotated code: Circles bouncing off lines

#25
Reminds me of a simple physics system I wrote a couple of years ago [0]. After writing a cloth simulation [1] I figured that all I needed to make them into collidable boxes was to have each dot collide with each line. I went in very very small steps, iterating each thing to ensure I understood it. The code was super verbose and I learned a lot from this about linear algebra, cross products, vector projection etc. I always planned to straighten the code out and do a proper writeup.

[0] https://www.youtube.com/watch?v=ud8NirjyLAA

[1] https://www.youtube.com/watch?v=G05M_Y6NQVM

Re: Annotated code: Circles bouncing off lines

#26

I think this is awesome but I think it's a little too spaced out. I like the side-by-side display (gives the code an approachable narrative) but I wish I had to scroll up and down (to remind myself of what's going on) less.

On mobile it combines the sides together in a way that I find an appealing option. Screenshot: http://imgur.com/xRvDubc

Anybody know if there's an easy way to get something like the mobile view on desktop (without spoofing user agents, etc)?

Re: Annotated code: Circles bouncing off lines

#27

Earlier quoted context omitted.

Do you also prefer footnotes and sidebars inline when reading articles? These are standard typographical practices. I do set my comment color to super light so comments don't distract me too much when reading code, but I wish there was a better way.

How about toggle-able comments?

Inline comments are a part of the code's core layout, so you get into trouble when you make them disappear (as is the trouble with most folding systems).

It is like parenthetical statements in prose: you can't really make them disappear, they are right their in your face. It is considered bad style if they aren't extremely brief, otherwise you should use a foot or side note.

Re: Annotated code: Circles bouncing off lines

#28
post #21

I hate this left/right code documentation fad with passion. Making my eyes jump horizontally across the page every few lines is about the worst you can possibly do for readability. Just keep the damn comments inline and use colors/font-faces/fold markers to make it readable.

Do you also prefer footnotes and sidebars inline when reading articles? These are standard typographical practices. I do set my comment color to super light so comments don't distract me too much when reading code, but I wish there was a better way.

Do you also prefer footnotes and sidebars inline when reading articles?

No. I prefer them at the bottom (that's why they're called footnote) and with a tooltip for convenience.

I don't see how that relates to the idiotic idea of scattering comments/code over two wide columns.

Re: Annotated code: Circles bouncing off lines

#29

I think this is awesome but I think it's a little too spaced out. I like the side-by-side display (gives the code an approachable narrative) but I wish I had to scroll up and down (to remind myself of what's going on) less.

On mobile it combines the sides together in a way that I find an appealing option. Screenshot: http://imgur.com/xRvDubc Anybody know if there's an easy way to get something like the mobile view on desktop (without spoofing user agents, etc)?

[deleted]

Re: Annotated code: Circles bouncing off lines

#30

Earlier quoted context omitted.

How about toggle-able comments?

Inline comments are a part of the code's core layout, so you get into trouble when you make them disappear (as is the trouble with most folding systems). It is like parenthetical statements in prose: you can't really make them disappear, they are right their in your face. It is considered bad style if they aren't extremely brief, otherwise you should use a foot or side note.

Why are people trying to make comments disappear? They are there for a reason. I agree with what moe is saying, though not moe's tone.
Post reply on HN