3 ms·
don't you find it a little painful to write code like that? When literate mode was first announced I had a go re-writing some small scripts in that style and fo
by phpnode 14y ago
don't you find it a little painful to write code like that? When literate mode was first announced I had a go re-writing some small scripts in that style and for some reason I found it a bit of a chore, especially when commenting on just one or two lines. I've been using
###
comment blocks
###
instead and I find that more readable, especially when dealing with indented code, e.g. a class body.
Edit - here's an example of some coffeescript written in this "illiterate" way, i'm using it with a (work in progress) preprocessor that spits out tests, html, markdown etc - https://gist.github.com/phpnode/2bf86b9633032a51d036 https://gist.github.com/phpnode/2bf86b9633032a51d036
- jashkenas 14y agoI think it definitely depends on what you're doing. We're by no means deprecating "ordinary" mode, where the code remains primary, and the comments are secondary. For me, it's most interesting for both exploratory programming -- where you don't quite know how to solve the puzzle yet, but you're in the process of figuring it out, and writing notes to yourself as you do so; as well as for polishing up finished pieces of code -- where you've carefully put a library together in a certain way, and you want to document every significant method with an explanation of why it's written the way it is.