Live data from Hacker News

Monospaced Programming Fonts with Ligatures

hanselman.com

161–170 of 246 posts

Re: Monospaced Programming Fonts with Ligatures

#161
I get really excited about this kind of thing.

At the same time, I'm amazed that we, developers of all people, still use mostly software from the 80's. At least conceptually, if not actual code.

I mean, our tools can be as awesome as we want them to be. An illustrator is at the mercy of others to improve his daily software. We're not.

And yet, we get all fired up when we are able to display thousands of colors, some pseudo GUI feature like menus or divisors by patching fonts or have text appear at the opposite end of the line simultaneously. Madness right? I know.

I'm as guilty as the next guy, my editor is Vim (on the terminal) and I spend ridiculous amounts of time tweaking tmux, bash/zsh and fetishizing over color schemes.

I can't help but feel that by now we should have an OpenGL rendered environment where something like SublimeText's minimap would be easy and Hollywood style interfaces possible, albeit excessive.

Re: Monospaced Programming Fonts with Ligatures

#162
post #18
post #10

My only real concern is that it makes 0x123 look like 0×123. Otherwise, pretty cool.

My concern is it made 0xABCDEF turn into 0xAB_DE_F. What happened to the "C"?

Sorry, the missing C is just me being sloppy. The underscores are a C#7ism where you they are ignored and people can use them to separate LONG hex literals.

Re: Monospaced Programming Fonts with Ligatures

#163
post #142

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

Agree on indentation-only-style. Alignment is just a painful mess to maintain every time I encounter it.

Use a decent code editor?

Jetbrains editors have it built in (change some settings and then ctrl+alt+l does it for you.) Sublime, VSCode, Atom, etc.. all have prettify plugins.

Aligned code is easy to read code. Aligning code is a pain in the ass. A good code editor once again saves the day (and man hours!)

Re: Monospaced Programming Fonts with Ligatures

#164

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…

One interesting talk I watched recently: https://channel9.msdn.com/Events/GoingNative/2013/The-Care-a...

In it, they make a really good argument that humans simply shouldn't be doing this type of formatting work. Let the computers do it, clang-format can get it right every time in a fraction of the time a human can.

Pick whatever style you want, let the computers deal with it. I quite like this, now I just write a big long single line, hit a button and have it fixed for me.

It's not a bad habit if it looks better and doesn't involve any time investment.

Re: Monospaced Programming Fonts with Ligatures

#165

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

Sized to fill my screen, it's about the same font size as my own. Maybe one point size (probably less than 1/32") smaller. The only major difference is that my fonts are smoothed by the higher resolution.

Re: Monospaced Programming Fonts with Ligatures

#168

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 means constant readjustment and unnecessarily bloated diffs every time you change a function or variable name.

Your variable example is the thing that peeves me most about golang, since gofmt insists on aligning consecutive variable names and types in that columnar fashion.

Re: Monospaced Programming Fonts with Ligatures

#169

Earlier quoted context omitted.

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.

To go further in this direction, check out Piet: https://en.wikipedia.org/wiki/Esoteric_programming_language#...

Re: Monospaced Programming Fonts with Ligatures

#170

Earlier quoted context omitted.

HN is a web page, and HTML swallows multiple-spaces into a single space.

Let me test                 something. Edit: crap, doesn't work

Unicode has some wonky characters - I use zero-width space, probably the most ridiculous of them to bypass filters at times. For intentionally wide spaces you have a few options:

Test unicode non-breaking space.

Test                                                                    unicode  narrow no break space.

Test                            unicode figure space.

EDIT: So there you have it, if you want a non-breaking space on hackernews, use unicode's figure space or narrow non-breaking space. Apparently they already filter out the normal non-breaking space.

Post reply on HN