Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

181–190 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#181
post #73

Earlier quoted context omitted.

I agree, except for the www ligature. It just looks odd to only have part of a domain name compressed.

www was unnerving to me (and a couple of my team members) too. In a way I am interested in psychological basis for my innate rejection of this. Conceptually, I comprehend why it is made into it's own ligature, like !=, it is a unit of information these days.

Well, for starters it's an abbreviation, whereas -> or != is an approximation of a symbol, so that makes it different from the rest. Also, you're on a website that has no www in any part of its website, so it's not nearly as ubiquitous.

If anything I think it makes more sense to have :// as a ligature.

Re: Monospaced Programming Fonts with Ligatures

#182
post #177
post #66

Earlier quoted context omitted.

I assume potential sarcasm would be related to the difficulty differentiating between similar symbols, based on length, with different lexicographic meanings. For example, dash vs endash vs emdash, etc: ‒ – — ― If those symbols were used in a programming language and had different meanings, differentiating quickly could be much more difficult than seeing the difference between -, --, ---, and so on at a glance.

Just recorded this GIF of typing out a function with the added visual cues: http://imgur.com/a/LQVV2 IMO it's comparable to a WYSIWYG equation editor vs looking at raw LaTeX - conceptual errors pop more.

OT, but out of curiosity what did you use to record this?

Re: Monospaced Programming Fonts with Ligatures

#183

> Picking a programming font is like picking a religion. No matter what you pick someone will say you're wrong. Most people will agree at least that monospaced fonts are ideal for reading code and that both of you who use proportionally spaces fonts are destined for hell, or at the very least, purgatory. I guess I'm destined for hell or purgatory then. Hanselman is not alone. I had the CEO of one company look over my…

Sublime-text-style multiple cursor text manipulation would break here. And your code would look different than everyone else's machine. How would you display a guideline to make sure you were under a characters-per-line style? What advantages are there? I could never see it working for me. I want a program to format my code with resonable defaults and be done with it.

How would multiple cursors be affected by this? I use a proportional typeface and multiple cursors for all sorts of things, I can't really see how these concepts are even related.

As you say, use automatic formatting and you don't need to worry about line-length. (Otoh, having a mandatory max line length makes about as much sense as having a max identifier length or a max lines per file.)

Re: Monospaced Programming Fonts with Ligatures

#184
post #178

> Picking a programming font is like picking a religion. No matter what you pick someone will say you're wrong. Most people will agree at least that monospaced fonts are ideal for reading code and that both of you who use proportionally spaces fonts are destined for hell, or at the very least, purgatory. I guess I'm destined for hell or purgatory then. Hanselman is not alone. I had the CEO of one company look over my…

I feel like proportional fonts make sense for me when coding in lisps. Not sure why.

I really wonder why, because alignment is one of the core things in lisp code style. Take this trivial snippet:

    (let ((foo 1)
          (bar 2))
      (print foo)
      (print bar))
The (print ...) statements should just be indented two spaces, so you don't need a monospaced font for that, but the bindings should be aligned... "(let (" in a proportional font generally won't have the same width as 6 spaces.

How do you deal with this?

Re: Monospaced Programming Fonts with Ligatures

#185

> I frankly can't understand how tiny font people can function. It gives me a headache to even consider programming at anything less than 14 to 16pt and I am usually around 20pt. What? I can't understand how such large font people can function. I mean, how large (or dense) are your screens? Is that a Macbook thing? I'm at... something small. Hard to tell exactly, because on my laptop screen, all following fonts look…

Given differences in monitor pixel densities, OS zoom levels, and distance from eyes to monitor, comparing any point/em/etc measure is practically worthless. For example, I can use a 12pt font on my macbook pro's screen, but have to go up to 16pt on my 4k display at home, and down to 9 or 10pt on the 1920x1024 screens in the office. It's a pain, but... Instead, if you really want to compare font sizes, compare either…

> Given differences in monitor pixel densities, OS zoom levels, and distance from eyes to monitor, comparing any point/em/etc measure is practically worthless.

That’s... false.

With correct DPI settings – determined by measuring – the same font size equals exactly the same physical size.

Re: Monospaced Programming Fonts with Ligatures

#186
post #183

Earlier quoted context omitted.

Sublime-text-style multiple cursor text manipulation would break here. And your code would look different than everyone else's machine. How would you display a guideline to make sure you were under a characters-per-line style? What advantages are there? I could never see it working for me. I want a program to format my code with resonable defaults and be done with it.

How would multiple cursors be affected by this? I use a proportional typeface and multiple cursors for all sorts of things, I can't really see how these concepts are even related. As you say, use automatic formatting and you don't need to worry about line-length. (Otoh, having a mandatory max line length makes about as much sense as having a max identifier length or a max lines per file.)

Max column length (line length) does make sense in one case. It simplifies side-by-side comparison. We have a max 100 column rule which is perfect for our merge and review tooling :). It was raised from 80 few years back and probably raises again to 120 as everybody has all their monitors 1920x1080 now. The idea is everybody should see the entire line in one go without wrapping enabled.

A second reason is that it prevents nesting as a side effect. You are forced to make methods and don't go into nested if/for. Much easier to check for our (custom) linter than verifying for/if nested loop depth.

Oh, Turning on word wrap is evil...

Re: Monospaced Programming Fonts with Ligatures

#187

> Picking a programming font is like picking a religion. No matter what you pick someone will say you're wrong. Most people will agree at least that monospaced fonts are ideal for reading code and that both of you who use proportionally spaces fonts are destined for hell, or at the very least, purgatory. I guess I'm destined for hell or purgatory then. Hanselman is not alone. I had the CEO of one company look over my…

On the one hand, I agree that the time of typewriters and their fonts is (or should be) long gone. On the other hand, something keeps telling me that program code is not (and should not be) exactly a piece of literature, and there may be some advantages to being able to see code as a two-dimensional object rather than linear text.

Re: Monospaced Programming Fonts with Ligatures

#188
post #55

> I frankly can't understand how tiny font people can function. It gives me a headache to even consider programming at anything less than 14 to 16pt and I am usually around 20pt. What? I can't understand how such large font people can function. I mean, how large (or dense) are your screens? Is that a Macbook thing? I'm at... something small. Hard to tell exactly, because on my laptop screen, all following fonts look…

What are you going to do when you get older and your eyes go through "the change"? You can keep your font sizes and wear readers, but then don't you have to move your head a lot to view the entire magnified image? Any presbyopic developers care to chime in on what the experience is like? I'm 40, so mine could cross over any time now. I hate 16:9 too. Please give me back the bottom of my screen that you chopped off.

I'm 50 and have been wearing glasses for about 6 years now.

Your neurology adjusts pretty quickly. The first few days, your field of view feels limited. After that it feels normal. It was a delight to adjust my font sizes down on all my devices, back to what I would have used at 30 years old.

Re: Monospaced Programming Fonts with Ligatures

#189
post #175

Earlier quoted context omitted.

nah, it's a bad habit. It means constant readjustment and unnecessarily bloated diffs every time you change a function or variable name. or the lovely foo := a; bar := b; then a day later foo := a; bar := b; foobar := cd; which also points to the problem that it lends itself to premature constant readjustment because a day later you have to move every thing again because as it turns out you really needed foobarlist a…

The diff could be smarter and notice that you just inserted some white space. Many GUI apps actually do that but unfortunately not your typical diff or git which insist in dealing with full lines only.

I'm sure many know, but for those who don't, `diff` (and `git diff`) accept -w and -b to ignore all white space and changes in the amount of white space, respectively. I find these very handy.

Somewhat related, if you're looking at a diff on GitHub and want to ignore whitespace, you can just tack on `?w=1` to the URL (https://github.com/blog/967-github-secrets).

Re: Monospaced Programming Fonts with Ligatures

#190

Earlier quoted context omitted.

> For example, it cured the bad habit I had of lining too many things up in columns I don't like this style either, but it's a style not a "bad habit."

nah, it's a bad habit. It means constant readjustment and unnecessarily bloated diffs every time you change a function or variable name. or the lovely foo := a; bar := b; then a day later foo := a; bar := b; foobar := cd; which also points to the problem that it lends itself to premature constant readjustment because a day later you have to move every thing again because as it turns out you really needed foobarlist a…

Here is a thought.

Maybe no formatting characters should be allowed to be saved embedded in source code, and instead presentation filters should handle everything related to formatting, documentation, etc.

It might work..

Post reply on HN