Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

131–140 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#131

Earlier quoted context omitted.

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…

I don't have a ruler handy, so here are two random screenshots I just made, showing terminal and Emacs font sizes I use, relative to my 1920x1080 laptop screen: https://i.imgur.com/dbijNop.png https://i.imgur.com/cS6EOhZ.png

How big is your screen?

Depending on your eyes that would be entirely reasonable on an 18 inch lapzilla or preposterously tiny on a 9 inch ultrabook.

Re: Monospaced Programming Fonts with Ligatures

#132

Earlier quoted context omitted.

After programming in SmallTalk for a while, I'm starting to come round to a similar point of view. I haven't quite made the leap in my day-to-day work yet, but I really am considering it. Another thing I'm considering to adopt from ST is dropping syntax highlighting. If research on highlighting for natural language can be transferred to code (I'm not entirely sure, but I suspect it might), highlighting might actually…

> If research on highlighting for natural language can be transferred to code (I'm not entirely sure, but I suspect it might), highlighting might actually be harmful to comprehension. Interesting. Could you share some of that research and its conclusions?

I don't remember whose research it is (it's a bit removed from my field of expertise =), but the gist of it is that they tried to highlight different parts of speech in running text in different colours, and showed that it actually decreased reading speed and comprehension.

Of course, there are several possible error sources (unfamiliarity with the colouring scheme for example), and whether this can be transferred to reading code is an open question. But I still think it's important to keep the existence of this kind of research in mind when discussing this kind of question (and also the similar question of mouse-driven interfaces vs. keyboard shortcuts), as it easily devolves into strongly held opinions and arguments along the lines of "it stands to reason that $opinion-held-is-true"

Re: Monospaced Programming Fonts with Ligatures

#133
post #129

Tiny font person reporting in. I can easily read 9pt font scaled to 80% or 90% in Qt Creator on my 4k monitor. Some of my other coworkers are unsure if I even have text on my screen. I do it because I can fit 4 split views of 120 columns text on my screen (at 90%, 5 at 80%). Right now I only have 3 split views, Unit tests, the header and the source file I am working on.That window does not take up the full screen and…

You're a god!

Re: Monospaced Programming Fonts with Ligatures

#134

This is a deeply personal choice, I feel. I am not a fan of using ligatures in programming code as it gives some abiguity around how many characters are in a given ligature. To each his/her own, I guess.

Does it? In monospaced fonts, you can use width to know how many characters are in a ligature.

Maybe I'm just not good at it. Maybe I don't want to have to think of one more thing. That's the point of monospaced fonts, after all.

Re: Monospaced Programming Fonts with Ligatures

#135

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

Great answer, thanks for that insight! (I was just joshing!)

Re: Monospaced Programming Fonts with Ligatures

#136

Earlier quoted context omitted.

After programming in SmallTalk for a while, I'm starting to come round to a similar point of view. I haven't quite made the leap in my day-to-day work yet, but I really am considering it. Another thing I'm considering to adopt from ST is dropping syntax highlighting. If research on highlighting for natural language can be transferred to code (I'm not entirely sure, but I suspect it might), highlighting might actually…

> Ideally, I think I'd like to have [comments] deemphasised by moving them off to the margin or something like that This is one reason I'm a fan of Douglas Crockford's slightly unorthodox style of always beginning comments in column 0, rather than indenting them along with the code. This helps, to a small extent, in differentiating comments from code. Example: https://github.com/douglascrockford/JSLint/blob/master/js…

Oh, that's an interesting idea!

Ideally, I'd prefer to float them to the right margin (suggesting the Lisp style of line comments starting at column 78 or thereabouts, I guess), but this is an acceptable compromise. At first blush it seems to break the flow of the code a bit too much, but I'd probably get used to it reasonably quickly, especially in conjunction with grey comments and black text.

Re: Monospaced Programming Fonts with Ligatures

#137
post #129

Tiny font person reporting in. I can easily read 9pt font scaled to 80% or 90% in Qt Creator on my 4k monitor. Some of my other coworkers are unsure if I even have text on my screen. I do it because I can fit 4 split views of 120 columns text on my screen (at 90%, 5 at 80%). Right now I only have 3 split views, Unit tests, the header and the source file I am working on.That window does not take up the full screen and…

You're a god!

Today I learned: god is nearsighted.

Re: Monospaced Programming Fonts with Ligatures

#138

> 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 would probably want to hit you with a baseball bat if I had to spend any time reading your code with my monospaced font. At least for the type of code that I work in that lends itself to code alignment.

Re: Monospaced Programming Fonts with Ligatures

#139
post #8

I really like the giant, triple-line === ligature for JS in Fira Code. Makes it super-obvious when you are doing strict vs sloppy equality checks.

Just use ESLint, you can make it impossible to commit when doing ==. You can exclude pretty common var == null idiom as well.

Re: Monospaced Programming Fonts with Ligatures

#140

Earlier quoted context omitted.

> If research on highlighting for natural language can be transferred to code (I'm not entirely sure, but I suspect it might), highlighting might actually be harmful to comprehension. Interesting. Could you share some of that research and its conclusions?

I don't remember whose research it is (it's a bit removed from my field of expertise =), but the gist of it is that they tried to highlight different parts of speech in running text in different colours, and showed that it actually decreased reading speed and comprehension. Of course, there are several possible error sources (unfamiliarity with the colouring scheme for example), and whether this can be transferred to…

On the other hand there is Color Forth, which replaces syntax with color. It produces extremely compact code.
Post reply on HN