Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

61–70 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#61
The edges of the WWW symbol need to align with the old symbol if they are doing it right.

The && also breaks out of alignment. Alignment is the whole reason I am using mono-spaced fonts.

My history: IBM VGA (strange j, h, k, etc.), Courier, Bitstream Vera Sans, Lucida Sans Italics (only proportional font, but it looked great at the time), Consolas, Kids Play.

Re: Monospaced Programming Fonts with Ligatures

#62
post #19

I personally love hasklig. Iterm2 has it on the Mac, but I'm sol on Ubuntu. Is there any good terminal app that supports ligatures? I tried konsole, but the font looked like it wasn't getting any anti-aliasing and was harder to read as a result. I love terminator, but it doesn't support ligatures. What do you use?

Most popular terminals use VTE. VTE doesn't support ligatures if that helps narrow your search down.

Re: Monospaced Programming Fonts with Ligatures

#63

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

Rotate your monitor 90 degrees. Or even better, get two monitors and have one rotated, and one normal. It ends up looking like a rotated T.

Code and web browsing (which is really just walls of text) goes on the tall one, everything else on the other one.

Re: Monospaced Programming Fonts with Ligatures

#64
post #33

Apparently I'm one of the two users of proportionality spaced fonts for coding. I've used this now for five years and I don't understand why developers still see this need to code as if monospaced terminals is all that's available. Especially on large screens with high dpi it reads much faster. It also makes it less awkward to use editor unicode substitution for display purposes.

It could be a function of the kind of programming you engage in.

When I write code that reads more like long-prose, then I do prefer proportionally-spaced fonts myself. This is generally characterized as code with a low density of variables and constants, and lots of control and data structure manipulation. However, when I write code with lots of objects, I tend to prefer monospaced fonts. This is because my personal aesthetic style is to line up groups of related entities and logic; an IDE that gives a modern example of doing this is Eclipse [1].

For IDEs I have to use for a specific project that don't support such formatting, Emacs makes this easy to re-flow so adding a new variable, shortening or lengthening an existing one is still quick. The impact upon version control is still annoying, though; AST-sensitive merge/diff/version-control can't arrive soon enough for me. Fortunately, my code is not regularly inflicted upon others within a team; when I do have to work within a team, I put up with not carrying out my personal preference and use the code formatter that comes closest to the team's formatting standards before checking in.

I do this because it helps me read my own source code quicker. Blocks of entities and logic related by domain and not intrinsically related through the language itself happen to be easier for me to read when I line up like this.

This all goes back to a phase I went through a long time ago when I tried to figure out how to adopt literate programming in all my own work, within the context of an integrated single-source publishing, version control, testing, training, and problem management environment. In my mind's eye, I imagined all the media and activities surrounding a software product related back to the code in some manner, with the code displayable in different contexts based upon the AST and domain-specific hints, and when I made a change in either, I could see and manage the change in the network of related nodes. So if I change how a GUI behaved, then the parts of the User Guide that reference the old GUI, list of users who logged problems documenting confusion about that part of the GUI, etc. would all be automatically flagged. The User Guide would automatically get updated graphics content available from the GUI testing as soon as the testing data was built, the training material as well, and the users would get a note from the support team when the next version was released, detailing the change. I eventually decided that mountain was one I wasn't going to grind down myself anytime soon, so my code formatting is one of the many small ways I preserve that ideal.

[1] https://stackoverflow.com/questions/13936569/eclipse-auto-al...

Re: Monospaced Programming Fonts with Ligatures

#65
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.

You could try rotating your screen to get 9:16, although I find that it tends to be a bit narrow if you want to split vertically and have two pieces of code side by side.

With 16:10 screens however I think it work rather well, I currently use three 1920x1200 monitors and two of them are vertical, it looks like this: https://svkt.org/~simias/emacs-vertical.png

It's also great for looking at docs.

Re: Monospaced Programming Fonts with Ligatures

#66

Earlier quoted context omitted.

Sarcasm?

Why would it be sarcastic? The triple bar is also the operator for logical equivalence, which I guess is where the font authors got it.

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.

Re: Monospaced Programming Fonts with Ligatures

#69
Oh, I didn't even know ligatures is a thing. Learned something.

When coding in Haskell, I used to use the vim-haskellConcealPlus [1] plugin for vim to swap chars being display into nicer unicode chars for various operations.

I'm no longer using it now because it wasn't monospaced and moving around lines was jarring.

If only there's a way to combine the benefits of the two. Monospaced font with ligatures seems to only work for operators that take the same amount of space as their ligature counterpart.

  [1]: https://github.com/enomsg/vim-haskellConcealPlus
Post reply on HN