4 ms·
On a tangential note, I have been wondering recently why programmers and the code editing software they normally use stuck to the typewriter/punchcard mindset a
by Koshkin 6y ago
On a tangential note, I have been wondering recently why programmers and the code editing software they normally use stuck to the typewriter/punchcard mindset as far as the code formatting and the choice of fonts are concerned...
- blacksmith_tb 6y agoYou certainly find some people who don't use monospaced fonts in their editors/IDEs, but of course while that may make for better readability on the line, you lose the consistent indentation (matters more for some languages than others, Python e.g.)
- hollerith 6y agoThere are some indentation styles where you don't lose consistent indentation in that situation.
- dragonwriter 6y agoYou don't lose consistent indentation at all with proportional fonts (N-leading-spaces provides a consistent horizontal position.) You do lose consistent non-indent alignment (N-leading space plus M-other characters doesn't consistently result in the same horizontal position for constant N+M, or even constant N and M, M>0.) For python, this is not a problem, as consistent indentation is important, but alignment is not (I use proportional fonts for Python and YAML all the time, and the only problem is how annoying the ASCII Art labels someone put in some of our YAML are without consistent alignment.)
- GoblinSlayer 6y agoAnd better readability is more important than ascii art.
- drenvuk 6y agoIf you're talking about monospace fonts well, eliminating layout variation eliminates noise. Spacing is predictable, so that gives you hints at a glance that your code is correct, line from line.
- systemvoltage 6y agoEntirely difference reasons for equally spaced letters. Typewriters had no way of adjusting kerning pairs. The space between ho and lo are different in proportional fonts. These are called kerning pairs. So, it was mechanically easier to make letters of same width. Code is monospaced for many reasons others have replied here.
- dragonwriter 6y ago> why programmers and code editing software they normally use stuck to the typewriter/punchcard mindset as far as code formatting and the choice of fonts are concerned... Because computers used to display exclusively in monospaced fonts and coding adapted to that, including use of character position in lines for visual alignment. There've been more recent moves away from that (both elastic tabstops and indent-only-and-never-align are approaches) but they haven't become universal so if you ever deal with code that isn't from a tightly controlled group with practices against position-based-alignment, you are going to run into code that uses it.
- cutler 6y agoBecause Python.