Live data from Hacker News

MonoLisa – A font designed for developers

monolisa.dev

171–180 of 294 posts

Re: MonoLisa – A font designed for developers

#171
post #78

I'm going to hop on my hobby horse again for a second: One of their first points is this: >Designing a monospace font is much harder than a traditional, proportional one: being constrained by the same width of all glyphs can result in a boring or unreadable font. And they're absolutely right. But it begs the first-principals question-- why code using a monospace font? Today, every major editor that isn't terminal-bas…

> And they're absolutely right. But it begs the first-principals question-- why code using a monospace font? Today, every major editor that isn't terminal-based supports proportional width fonts beautifully. There was a whole "coding font" family designed around the idea that we should be using proportional fonts for this, and it makes a great case... https://input.djr.com/info/ ...except that just about every time I…

> Put that in a [proportional] font, and the asterisks on the first line probably won't line up with the rest.

You quickly learn not to care about that. So what if the asterisks in the first boilerplate line don't line up with the ones below? And which of those two asterisks should have lined up with the others?

It just doesn't matter. Everything in the meat of the comment still lines up just fine in a proportional font, just as it does in monospace.

> Now think of someone doing visual alignment of assignment operators in a block of code like you often see in Ruby

I gave up that coding style many years ago, even before I switched to proportional fonts. You end up doing stuff like this (making up a contrived example, and not in any particular programming language here):

  name                  = user.name
  age                   = user.age
  driver_license_number = dl_database(user).dl_number
Sure, it looks nice to see the "= user.etc" lined up, but does it actually help the readability and maintainability of the code? I used to think so, but I don't any more.

Maybe it is because I am getting older and all that sideways visual scanning is not as pleasant as it used to be. Maybe it is because of the unnecessary commit diffs that this style produces.

Once I stopped doing this, I realized that the code would look fine in any font, mono or proportional.

> or any code following the indentation standard where you line up parameters in a multi-line function header with the character after the open parenthesis like you often see in Python.

It's worth noting that Black, by far the most popular Python formatter, eschews column alignment in favor of a purely indentation-based format. Python code formatted with Black is just as readable in a proportional font as in monospaced.

Here is a more extreme example from Rust, whose rustfmt tool used to rely heavily on the kind of column alignment you're talking about:

    let mut rewrites = try_opt!(subexpr_list.iter()
                                            .rev()
                                            .map(|e| {
                                                rewrite_chain_expr(e,
                                                                   total_span,
                                                                   context,
                                                                   max_width,
                                                                   indent)
                                            })
                                            .collect::>>());
The Rust team later saw the disadvantages of this kind of column alignment and switched to an indentation-based format fairly similar to Black:

    let mut rewrites = try_opt!(
        subexpr_list
            .iter()
            .rev()
            .map( |e| {
                rewrite_chain_expr( e, total_span, context, max_width, indent )
            })
            .collect::>>()
    );
(That may not be the exact rustfmt style, but it's pretty close, and it illustrates the benefit of simple indentation vs. column alignment.)

> re-teach a generation or two of programmers that indenting with the tab character is good, actually

Bless you for that! This is another advantage of indentation-only formatting. It stops mattering whether you use tabs or spaces! The code will be just as readable in any font, monospaced or proportional, and it won't matter at all if one dev prefers to render tabs as two spaces and another likes four.

The key to all of this is to abandon the kind of column alignment that monospaced fonts make so tempting.

I do agree with your point about Lisp. Monospaced fonts are so heavily ingrained in that culture that I couldn't begin to imagine how to change it.

Re: MonoLisa – A font designed for developers

#173
post #103
post #78

I'm going to hop on my hobby horse again for a second: One of their first points is this: >Designing a monospace font is much harder than a traditional, proportional one: being constrained by the same width of all glyphs can result in a boring or unreadable font. And they're absolutely right. But it begs the first-principals question-- why code using a monospace font? Today, every major editor that isn't terminal-bas…

> why code using a monospace font? Because unlike prose, we don’t reason about code in terms of words, sentences or paragraphs but rather in terms of statements, lines and blocks. Navigating between visual lines vertically makes sense when navigating in code. And to optimize this kind of navigation, monospace fonts are the best choice because where your cursor lands is predictible. It also brings cool features such a…

I don't quite understand this. I've used proportional fonts in PyCharm and other editors for many years, and vertical navigation and block selection work fine.

Re: MonoLisa – A font designed for developers

#174
post #78

I'm going to hop on my hobby horse again for a second: One of their first points is this: >Designing a monospace font is much harder than a traditional, proportional one: being constrained by the same width of all glyphs can result in a boring or unreadable font. And they're absolutely right. But it begs the first-principals question-- why code using a monospace font? Today, every major editor that isn't terminal-bas…

Proportional fonts break code navigation, moving vertically is much more important in code than normal text. Also it's harder to line things up, and alignment is a good cue when scanning code.

I would argue that most use of column alignment in source code hampers readability and maintainability.

There are some exceptions, of course. If you are writing out hard coded matrices, you may want to line up the numbers.

But how many of us really do that day to day?

Many modern formatters such as Black for Python and rustfmt for Rust avoid column alignment and prefer indentation instead. Then the code is equally easy to read and navigate in any font of choice, proportional or monospaced.

Re: MonoLisa – A font designed for developers

#175

Earlier quoted context omitted.

I wanted to let you know I'm upvoting you, not for the useful links you have provided, but because I also love DIN, to an unreasonable degree, like the kind of feeling that makes someone otherwise totally rational marry a pokemon. When I was about 20, after the Berlin wall came down, I rode my bike round berlin, then all round east then west Germany for three months, sleeping rough in the forest most of the time, and…

> There's a moment in the film in which hilter interacts with an unemployed labourer, and in that interaction he imbues this guy with a sense of purpose, hitler has told him he is a soldier - a soldier with a shovel, it's nonsense, but it is carefully crafted nonsense. Well, maybe not total nonsense? The same kind of thing seems to have worked elsewhere too: https://en.wikipedia.org/wiki/Works_Progress_Administration

That's more or less what I'm trying to say, the little morsel of self esteem given to labourer, the sense of purpose and inclusion, comes tangled up in an insane and horrific ideology, if he wants to eat that morsel he needs to swallow the other part too. So the strategy isn't nonsense, it's nasty, but not nonsense. The human need for inclusion and self esteem is real, responding that need is real, the nonsense is the mythology in which that response is served.

Re: MonoLisa – A font designed for developers

#176

Earlier quoted context omitted.

Lucky for you, you can disable ligatures or not use a font that you don't like.

How about whoever wants them to enable them?

That's up to your editor, the font doesn't get to choose what the default is.

Re: MonoLisa – A font designed for developers

#177

If you're willing to spend money on a font for coding, then do yourself a favor and take a look at PragmataPro as well. I bought a license (checks notes...) 8 years ago and it has served me very well. If I was not down to pay for a font, then I'd probably use one of Iosevka's forms. Personally, however, it became clear to me that just like my monitor, the font I spend hours looking at every day is also worth some mon…

Pragmata Pro is quite nice... but not for coding. I like narrow fonts. Barlow is excellent. News Gothic is fantastic. Geo Grotesque is super beautiful. But it just doesn't work for me when a coding font is narrow. Fonts like Iosevka and Pragmata are harder to read than needed and for no clear benefit. Especially when used for projects based on C and derivatives. If you ever find yourself needing to cram more symbols…

Ever tried editing two files side by side on a 13-14" screen? Good luck without a narrow font or tiny font sizes. Meanwhile I find narrow fonts just as readable, so for me it's an easy choice.

Re: MonoLisa – A font designed for developers

#178

Please stop it with the "coding ligatures" already. They are not helpful and only serve to obscure the code being written. This has got to be one of my least favourite trends in programming aesthetics these days. For a font claiming to "follow function" to devote so much effort to sacrificing function for the _vogue du jour_ is especially rich.

A ligature is more functional than not using one. They obscure the code for about 5 seconds the first time you see them, and then never again. After those 5 seconds, you register a new semantic symbol in the brain. It is objectively easier for your brain to parse a single arrow symbol than it is to parse => in a monospace font. For the latter, you are scanning two symbols and only after seeing them both can your brain put them together into a semantic meaning. This is strictly worse than just seeing an arrow symbol and understanding it is an arrow.

Re: MonoLisa – A font designed for developers

#179

Please stop it with the "coding ligatures" already. They are not helpful and only serve to obscure the code being written. This has got to be one of my least favourite trends in programming aesthetics these days. For a font claiming to "follow function" to devote so much effort to sacrificing function for the _vogue du jour_ is especially rich.

A ligature is more functional than not using one. They obscure the code for about 5 seconds the first time you see them, and then never again. After those 5 seconds, you register a new semantic symbol in the brain. It is objectively easier for your brain to parse a single arrow symbol than it is to parse => in a monospace font. For the latter, you are scanning two symbols and only after seeing them both can your brai…

If this wasn't a discussion about monospace fonts, I might be inclined to agree with you. However, I kinda agree with the detractors here; ligatures objectively defeat the purpose of equally-spaced characters. The purpose of monospace fonts is to provide definitive clarity where sans and serif fonts fail to do so. In the world of programming, maintaining that consistency is essential. Having one symbol span several spaces undermines that clarity, you may as well be reading your code with Helvetica at that point. I understand that programming is a career path filled with creature comforts and obscure little things that make you happy; I even enjoy the warp cursor (gasp!) in VS Code, which definitely doesn't contribute to clarity. Let's stop treating ligatures like a direct upgrade over normally printed monospace, though. It's an option, one that shouldn't come enabled by default but one that should be available for people who want them for whatever reason.

Re: MonoLisa – A font designed for developers

#180

Please stop it with the "coding ligatures" already. They are not helpful and only serve to obscure the code being written. This has got to be one of my least favourite trends in programming aesthetics these days. For a font claiming to "follow function" to devote so much effort to sacrificing function for the _vogue du jour_ is especially rich.

A ligature is more functional than not using one. They obscure the code for about 5 seconds the first time you see them, and then never again. After those 5 seconds, you register a new semantic symbol in the brain. It is objectively easier for your brain to parse a single arrow symbol than it is to parse => in a monospace font. For the latter, you are scanning two symbols and only after seeing them both can your brai…

If your programming language wants to use an ⇒ symbol there's a perfectly good codepoint for that already. I don't want complexity to be hiding in my font where I would never even think to look for it. (For example imagine searching the documentation to understand a use of ⇒ and finding it doesn't exist in your programming language)
Post reply on HN