Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you code in a style that uses data literals (lists/arrays and dictionaries/hash tables) to represent how an important part of the code is going to work -- e.g. a table that maps letters or keywords to argument lists used in some corresponding function -- then monospace fonts and block selection go well together. You can tweak one column at a time without upsetting the others if you set it up properly.

(Python's PEP8 is meant to take care of abuses, like lining up all the equal signs in a series of assignments or keyword arguments -- you wouldn't think of those as columns of data in a table, so there's no point in formatting the code that way.)

Also, monospace makes punctuation more prominent. Bjarne Stroustrup's C++ reference book uses a mixed font in its code examples, with monospace punctuation characters and proportional-font identifiers. It's weird but effective. I suppose if your code doesn't do exciting things with punctuation characters, and doesn't embed tables of data, then a proportional font would be just fine.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: