Live data from Hacker News

Programming with proportional fonts is great

m-mz.posterous.com

11–20 of 52 posts

Re: Programming with proportional fonts is great

#11
post #6
post #3

Earlier quoted context omitted.

I'm not sure I understand. Was using a proportional font changing the way you chose to format the code to such a degree that it annoyed people?

Leading spaces aren't much of a problem, but aligning comments on the right-side is much harder due to the variable widths of each line. And even if you align them in your editor, they'll be misaligned for people who use fixed-width fonts. Does that make any sense?

It does. However a lot of people avoid comments on the same line as code.

Re: Programming with proportional fonts is great

#12

i don't know. Taking a clojure example : (defn say [word] (println "You said" word)) This wouldn't be possible without fixed width. Now a lot of languages don't use that kind of indenting a lot, but in lisps it's mandatory. Also fixed width ensures that you can write code and it will lay in the same way on other computers, regardless of what other fixed width font they're using. That's a big big point i think, since…

I agree, but I think it would be possible to have proportional text aligned properly if you are working above the level of raw text, as in with sexps in paredit.

Re: Programming with proportional fonts is great

#13

I can't stand proportional fonts for programming. Aside from it being harder for me to read, inability to use any sort of ASCII art, etc, it just feels sacrilegious. Not to mention my editor of choice (TextMate) fails horribly with proportional fonts. But then again, I used to feel the same way about anti-aliased programming fonts, and have since switched. Currently Inconsolata 16pt anti-aliased is my font of choice.…

> inability to use any sort of ASCII art

That actually makes me support the idea of using proportional fonts even more.

- If something's that complex you need a diagram to support it, that probably doesn't belong in your code - you should maintain documentation in documentation format, and doc updates shouldn't mean new code revisions. Throw a URL to the documentation in as the comment.

- Diagrams could be illustrated much better with an actual diagram rather than an ASCII visualization of one.

Re: Programming with proportional fonts is great

#14
post #12

i don't know. Taking a clojure example : (defn say [word] (println "You said" word)) This wouldn't be possible without fixed width. Now a lot of languages don't use that kind of indenting a lot, but in lisps it's mandatory. Also fixed width ensures that you can write code and it will lay in the same way on other computers, regardless of what other fixed width font they're using. That's a big big point i think, since…

I agree, but I think it would be possible to have proportional text aligned properly if you are working above the level of raw text, as in with sexps in paredit.

There are good heuristics for checking whether spaces are being used for indentation. You can look at where they appear in the line, for one thing, and whether they're in clumps of two or more for another. In those cases it would be simple enough to make them align perfectly with the characters above/below them.

Of course, you'd have to decide which to do - above or below. There are reasonable heuristics for that, but they're probably more complicated and less accurate.

The nice thing about doing it this way is that it degrades perfectly when the code is viewed in fixed-width (which is good for tools and other developers).

Re: Programming with proportional fonts is great

#17
I switched to a proportional font by mistake when I started using acme as my primary editor. A few months later I realized what had happened and tested how things looked in fixed width. Turns out I like proportional better.

A big difference was probably the fact that the codebase I was editing used tabs for indenting and had non-ascii art indenting rules (basically just indent the next line).

Re: Programming with proportional fonts is great

#18
post #13

I can't stand proportional fonts for programming. Aside from it being harder for me to read, inability to use any sort of ASCII art, etc, it just feels sacrilegious. Not to mention my editor of choice (TextMate) fails horribly with proportional fonts. But then again, I used to feel the same way about anti-aliased programming fonts, and have since switched. Currently Inconsolata 16pt anti-aliased is my font of choice.…

> inability to use any sort of ASCII art That actually makes me support the idea of using proportional fonts even more. - If something's that complex you need a diagram to support it, that probably doesn't belong in your code - you should maintain documentation in documentation format, and doc updates shouldn't mean new code revisions. Throw a URL to the documentation in as the comment. - Diagrams could be illustrate…

[deleted]

Re: Programming with proportional fonts is great

#19
post #13

I can't stand proportional fonts for programming. Aside from it being harder for me to read, inability to use any sort of ASCII art, etc, it just feels sacrilegious. Not to mention my editor of choice (TextMate) fails horribly with proportional fonts. But then again, I used to feel the same way about anti-aliased programming fonts, and have since switched. Currently Inconsolata 16pt anti-aliased is my font of choice.…

> inability to use any sort of ASCII art That actually makes me support the idea of using proportional fonts even more. - If something's that complex you need a diagram to support it, that probably doesn't belong in your code - you should maintain documentation in documentation format, and doc updates shouldn't mean new code revisions. Throw a URL to the documentation in as the comment. - Diagrams could be illustrate…

Design documents and complex diagrams don't belong in code, but a simple ASCII diagram right there in the code to illustrate how the transformation tree is created:

- is always within easy reach of the eye.

- is harder to forget about when changing the code.

- doesn't require you to download, install, register and fire up Visio Community Edition 2008 to add a new FileLogger node to the illustration of the data transformation tree.

Post reply on HN