Live data from Hacker News

Programming with proportional fonts is great

m-mz.posterous.com

31–40 of 52 posts

Re: Programming with proportional fonts is great

#32
post #29

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.

Except for Tabs, obviously. All those problems are space-specific ;)

Re: Programming with proportional fonts is great

#33

Earlier quoted context omitted.

http://en.wikipedia.org/wiki/Acme_(text_editor) Available for Lunix (Linux / Unixes / etc) http://swtch.com/plan9port/

I'm not sure I'm smart enough to use it, much less understand it. I can understand that it's mouse based though, and I can't grasp how that would be more efficient for the way I code. I am intrigued by the idea of no built-in commands, relying instead on making external commands easy.. I guess I should look at Oberon again too. http://doc.cat-v.org/plan_9/4th_edition/papers/acme/

It works best with the plumber, which is to pattern matching as file name extensions are many file browsers. Plumb a uri and it opens the browser, unless you added a more specific rule to follow a different action.

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).

Re: Programming with proportional fonts is great

#34
post #31

ugh, syntax highlighting this is what I use, it's available for Lunix too http://en.wikipedia.org/wiki/Acme_(text_editor)

> ugh, syntax highlighting Care to explain? I didn't know there was debate on this point.

There is no debate on my personal preferences. But do you actually think that everyone uses syntax highlighting?

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.

Re: Programming with proportional fonts is great

#35
post #31

Earlier quoted context omitted.

> ugh, syntax highlighting Care to explain? I didn't know there was debate on this point.

There is no debate on my personal preferences. But do you actually think that everyone uses syntax highlighting? 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.

As crazy as it sounds, for the longest time I used notepad as my primary editor. Then I switched to Notepad+ (still no highlighting). I'm now on TextMate (mostly due to my switch to OSX), but I find the syntax highlighting to help in quickly scrolling through and finding segments of code. If I'm looking for a variable, I just look for that color, etc.

Re: Programming with proportional fonts is great

#36
post #22

It's hard to keep code within the 80 char per line limit of PEP8 without using fixed-width.

then again, that's probably the most obsolete recommendation in PEP8

I really like having two 80-char wide Emacs buffers side by side.

Re: Programming with proportional fonts is great

#38
post #32
post #29

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.

Except for Tabs, obviously. All those problems are space-specific ;)

You didn't notice I right justified then. My peeve with embedded tabs is they are editor-defined and generally too wide.

    i       = 0.0;
    Tomato  vs.     Tomahto
    Integer vs. Doubles
    Integrals       vs.     Derivatives

Re: Programming with proportional fonts is great

#39

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.…

Why do proportional fonts fail so bad with TextMate?

Re: Programming with proportional fonts is great

#40

In my experience, proportional typefaces only work for code if the IDE/editor is using a pretty-printer that uses word-processor style indentation. (That is, it uses tab stops as opposed to just inserting spaces/tabs in the text.) 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…

Maybe not an IDE, but the AppleScript Editor in Mac OS X (and Classic, IIRC) has you enter text in fixed width by default, but then changes it to a proportional font after syntax-checking.
Post reply on HN