11 ms·
I remember reading one of Douglas Hofstadter's books - Metamagical Themas - and liking the bold Helvetica font he used for all the Lisp code. But I doubt he cod
by cormullion 15y ago
I remember reading one of Douglas Hofstadter's books - Metamagical Themas - and liking the bold Helvetica font he used for all the Lisp code. But I doubt he coded with it...
- tjr 15y agoI've not read Metamagical Themas, but your words remind me that one of my favorite programming books, The Little Schemer, does in fact use a variable-width font for the code.
- tikhonj 15y agoI think Lisp is much more amenable to proportional fonts because it relies more on parentheses than indentation for structure.
- muxxa 15y agoEach space in a proportional font is a set width, so the indentation structure is just as clear as with a fixed width font. Am I missing something? I can only imagine a problem if there is a mix of tabs and spaces..
- haldean 15y agoIt's not about getting adjacent lines with equal depth to line up. Its when you are indenting, and try to put yourself four spaces in. In a fixed-width font, you can just line yourself up with the fourth character of the previous line. In a variable width font, it's harder to tell how many spaces in you've gone.
- muxxa 15y agoAh, ok. This problem doesn't manifest in emacs, as the tab key indents you correctly by 4 spaces in most modes. I can't imagine it's much of a problem to line yourself up with the first character of the previous line and press the spacebar 4 times though.
- waqf 15y agoAny reasonable editor can be set up so that the tab key will take care of that: ideally, you would also indent with tabs not spaces, and then you could set any tab width (in pixels, or better, points) you wanted and your code would still look right. The problem comes if you want to left-align some code with a character on a previous line which is not the first non-space character. People often do this for run-on lines, for instance. Then there's no guarantee that spaces or tabs will align you correctly. The ideal solution to the latter problem is: (i) Don't Do That, Then. (ii) If you want to align code in some carefully prescribed circumstances such as run-on lines, your editor should handle it for you when it displays on the screen (and the alignment hints need never make it into the saved file).