Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

221–230 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#221
post #177

Earlier quoted context omitted.

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.

Also out of curiosity, what editor / plugins are those?

Just VSCode with the ESLint plugin and this theme: https://marketplace.visualstudio.com/items?itemName=jdinhlif...

Re: Monospaced Programming Fonts with Ligatures

#222
post #15

I like switching fonts every couple of years just to keep it fresh. My font right now is Iosevka: https://be5invis.github.io/Iosevka/ A font generated from its source code. You can build your own variant. It has ligatures as well. I like that it’s not as wide as many other monospace fonts.

My problem with Iosevka (and Input and others like them) is that the [x-height][0] is too large, ie the bottom-half parts are too tall compared to the top-half and uppercase letters. Especially in less-wide weights, it feels muddy and hard to distinguish. [0]: https://en.wikipedia.org/wiki/X-height

You can probably tweak a couple numbers in parameters.toml or something. I made my own weight in between normal and medium, for example.

Re: Monospaced Programming Fonts with Ligatures

#223
post #15

I like switching fonts every couple of years just to keep it fresh. My font right now is Iosevka: https://be5invis.github.io/Iosevka/ A font generated from its source code. You can build your own variant. It has ligatures as well. I like that it’s not as wide as many other monospace fonts.

I love Iosevka Term! My only issue with it is that there seems to be a problem in Emacs 25 that makes the screen flicker once in a while when I use it. For Emacs, I like to use Fantasque Sans Mono, another amazing font.

You mean the screen flicker is from ... Iosevka? :(

Re: Monospaced Programming Fonts with Ligatures

#224

I am a huge, huge fan of the free font “Input”[1]. Just love how customizable it is, so much so, that I’ve replaced Pragmata Pro with Input on Sublime. [1] http://input.fontbureau.com/

I was looking for someone mentioning Pragmata Pro, now I might check out Input…

Re: Monospaced Programming Fonts with Ligatures

#225

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…

It's a non problem. Use a code formatter prior to code commit.

If needed allow your editor to have a task to reformat a code file on Open to apply formatting you desire vs the teams or project guidelines.

Re: Monospaced Programming Fonts with Ligatures

#226
post #76

Honeslty, this should be handled by the language itself. If a language supports unicode, why not support ≠ for not-equals instead of "!="? Then provide a pre-processor that will replace all your ugly "!=" with the correct mathematical symbol.

> If a language supports unicode, why not support ≠ for not-equals instead of "!="? Perl 6 tends to support both multicharacter ASCII operators and single-character Unicode equivalents.

I love the way Perl 6 looks with Unicode, it's really beautiful, but I'm just not very comfortable typing Unicode. It takes me a split second to type ">>*I think doing it with the font might actually be nicer from a usability perspective. Unicode is fun to play with but slows me way down.

Re: Monospaced Programming Fonts with Ligatures

#227

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

What about code that naturally represents tables, like this?

    rotationMatrix = [[ cos(x), -sin(x), 0],
                      [ sin(x),  cos(x), 0],
                      [      0,       0, 1]]

Re: Monospaced Programming Fonts with Ligatures

#228

Earlier quoted context omitted.

Block selection and anything having to do with IO formatting are very good reasons why monospaced fonts are still useful. That being said the idea that a programmer being resistant to changing their font style is indicative of general intellectual laziness is one of the most laughable things I've ever heard. I'd be more convinced if someone told me that refusing to change syntax highlighting themes implied you're a b…

> ...the idea that a programmer being resistant to changing their font style is indicative of general intellectual laziness is one of the most laughable things I've ever heard. Let me just mention that this isn't what I said at all. I don't blame you for misunderstanding, I must not have explained my thoughts clearly. I didn't say anything about intellectual "laziness", and I certainly didn't mean that someone who di…

[deleted]

Re: Monospaced Programming Fonts with Ligatures

#229

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.

My thoughts exactly. Aesthetically, I love these ligature fonts, and I think it's great if people are using these and enjoying them. But I just know that, if I used one of these fonts, I'd have to mentally convert the ligatures back into the real characters. It would use up brainspace that would be better spent on actually writing code.

Re: Monospaced Programming Fonts with Ligatures

#230
post #227

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

What about code that naturally represents tables, like this? rotationMatrix = [[ cos(x), -sin(x), 0], [ sin(x), cos(x), 0], [ 0, 0, 1]]

Yup, that's a great example of where a monospaced font helps. I don't claim that proportional fonts are ideal for every kind of code, only that it's an educational experience to try them out, even if just for a while.

Your example is interesting because it combines two different kinds of alignment. One of them I find unhelpful - pushing everything to the right to match the length of the variable name. The other is the useful alignment within the matrix. So personally I would make this minor change:

  rotationMatrix = [
      [ cos(x), -sin(x), 0 ],
      [ sin(x),  cos(x), 0 ],
      [      0,       0, 1 ]
  ]
Now you have the nice matrix layout without having to realign the code if you ever rename rotationMatrix.
Post reply on HN