2 ms·
> Ideally, I think I'd like to have [comments] deemphasised by moving them off to the margin or something like that This is one reason I'm a fan of Douglas Cro
by oneeyedpigeon 9y ago
> Ideally, I think I'd like to have [comments] deemphasised by moving them off to the margin or something like that
This is one reason I'm a fan of Douglas Crockford's slightly unorthodox style of always beginning comments in column 0, rather than indenting them along with the code. This helps, to a small extent, in differentiating comments from code. Example: https://github.com/douglascrockford/JSLint/blob/master/jslint.js#L133 https://github.com/douglascrockford/JSLint/blob/master/jslin...
- arnsholt 9y agoOh, that's an interesting idea! Ideally, I'd prefer to float them to the right margin (suggesting the Lisp style of line comments starting at column 78 or thereabouts, I guess), but this is an acceptable compromise. At first blush it seems to break the flow of the code a bit too much, but I'd probably get used to it reasonably quickly, especially in conjunction with grey comments and black text.
- djur 9y agoThis resembles certain forms of literate programming, like Haskell's "Bird style"[1] or Literate Markdown: [1]: https://wiki.haskell.org/Literate_programming https://wiki.haskell.org/Literate_programming [2]: https://ghc.haskell.org/trac/ghc/wiki/LiterateMarkdown https://ghc.haskell.org/trac/ghc/wiki/LiterateMarkdown I've dabbled with it and enjoyed it, but I really feel like it needs editor support to feel truly fluent (i.e. being able to preview the formatted version on the fly, being able to collapse the text blocks, etc.).