Programming with proportional fonts is great
m-mz.posterous.com
m-mz.posterous.com
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. It helps to have a big screen...
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.
- 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.
Personally I also have a lot of trouble reading ASCII diagrams. Knowing that pipe-slash-dash is a curved line, when the line is broken and the ends don't line up properly.
On a separate note, I suggest whoever moderated me to zero should read the HN guidelines.
Edit: Hah, I swear I didn't notice that Growl notification in the corner until just now...
A possible benefit of fixed-width: say you take a for-loop (which you can probably recognise even skipping over 95% of the characters) - now your brain wants to extract the indices at which it starts and ends: it seems to me a fixed-width font makes it easier to predict where you'll find the indices in the given line. (Not sure if that's how my eye-coordination really works, but it feels like it does...)
(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 code is most of the time a collaborative effort
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).
I would imagine special proportions for markers like (){}[] and punctuation marks and fixed proportions for numbers. At one point the difference between that and syntax highlighting and automatic indentation blurs.
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).
Ultimately, a space is a space in whatever font, so everything still lines up along the left margin nicely.
See, for an example implementation, BlackBox Component Pascal - Windows only, but runs moderately well under Wine.
More examples: http://mysite.verizon.net/astronaut/vim/align.html#Examples
Of course, I really hope nobody's coding like that. I've never seen anyone who's been able to maintain that kind of formatting consistently.
I don't see any reason why proportional fonts shouldn't work for most programming styles. The problem is that most existing proportional fonts aren't very well suited for programming. At the very least, you need a font with unambiguous shapes for similar glyphs, like 1lI0oO`',.;:
I've used proportional fonts since the early nineties and written thousands and thousands of lines of code since then in a proportional font. I have occasionally tried to go back to a fixed width font but I can't be bothered trying to get past the "it makes my head" hurt stage. (and likewise I can't imagine a lot of fixed width people getting past that stage going in the other direction).
We can rationalise our choices all we like but I doubt that there is any serious advantage or disadvantage in either.
The only IDEs I've seen work this way was the old THINK Pascal from the 68k Mac era, and its predecessor Instant Pascal for the Apple II. Anybody else seen a more recent example in the wild?
EDIT: I checked my dev environments, and it turns out both Eclipse and Visual Studio support proportional fonts in the code editors. I had just never thought to look.
Tomato vs. Tomahto
Bug vs. Feature
Tabs vs. Spaces
Either approach introduces about as many problems as it solves. I personally like being able to line things up with a few extra spaces to give some hints to my future self regarding the structure of my code. i = 0.0;
Tomato vs. Tomahto
Integer vs. Doubles
Integrals vs. Derivatives(and extra points to the grandparent for the ironically mis-spaced "tabs vs. spaces" chart!)
Of course proportional fonts can be read faster. That's not the point. Programming uses lots of non-standard glyphs, has meaningful syntax (eg. parens, brackets), and often meaningful whitespace. You can real _words_ faster in proportional font, but (arguably) not _code_.
I agree completely.
E596: Invalid font(s)
I just can't bring myself to use emacs.Available for Lunix (Linux / Unixes / etc)
http://swtch.com/plan9port/man/man4/plumber.html
For instance in Plan 9 I mount the file system of my webserver (across the internet), tail -f /n/remote/var/log/httpd/error_log.
An example error would be
[Thu Nov 26 15:28:15 2009] [error] PHP Warning: Invalid argument supplied for foreach() in /staging/php/restricted.class on line 286
For which I have a plumbing rule
type is text
data matches '(/staging/[^ ]+) on line ([0-9]+)?'
data set /n/remote/var/www/$1
attr add addr=$2
plumb to edit
plumb client $editor
My apache is chrooted so I set the un-chrooted path with relation to my plan 9 (the remote server is mounted at /n/remote)So in Acme I plumb the error message and Acme opens the file (if it isn't open) and scrolls to the appropriate line.
Ok this is nothing amazing in and of itself, other editors can do similar things - EditPlus on Windows can scan error messages) but combining simple things like this makes a bigger system.
Typing your own menus is also a great feature. You can whip up an awk script and apply it to selected text.
Here's a little one
http://plan9.bell-labs.com/sources/contrib/maht/rc/exe
If I type 'exe doit' in the current window, select the text and middle click it creates the file (in the pwd of that window) , chmods it, adds the hash bang and opens it in new window.
Again, not amazing on it's own but one builds up such things over time and there is no restriction on what language to use, I even have a few that ssh into a remote server and run them there.
There is no best editor, but Acme is the best for me.
Oh and if you middle click Font it switches between the two specified fonts (sans and mono by default).
"Limit all lines to a maximum of 79 characters."
this is what I use, it's available for Lunix too
Care to explain? I didn't know there was debate on this point.
Obviously Dennis Ritchie and Rob Pike didn't need it and though I don't in any way pretend I'm in that league of programmers, I am in that league of editor users.
grep '^fname' *.c
is good enough for me