Live data from Hacker News

Dev Fonts

devfonts.gafi.dev

271–280 of 342 posts

Re: Dev Fonts

#271
post #170

I've been programming for over three decades, on many different systems with many different fonts. This topic pops up every so often but I cannot help but think that to me, it's the ultimate bikeshedding...

I agree, each time I find myself trying new themes or fonts, I realize I've been stuck on a very hard problem for a few days. And my brain is just trying to get something, anything, done. So I start focusing on small unimportant details to feel like something is progressing.

Re: Dev Fonts

#272
post #226
post #78

Earlier quoted context omitted.

Personally, my eyes and brain just can't scan ligatures in code efficiently, I have to double read the code, especially "is that =, ==, or ===? Oh, and that's !==" (edit) I'll additionally qualify my comment, from a mathematics background I can casually scan a handwritten "!=" which is the same as the ligature, but I just cannot retrain my adult brain to accept the ligature version which is the same as the handwritte…

Not for comparison, but for boolean checks I prefer to use `foo == false` instead of `!foo`, the latter is easy to overlook.

Do all languages have `foo === false`? When testing booleans, I always do the type specific test to avoid `foo = 0 !== false` stuff

Re: Dev Fonts

#273
post #249
post #219

Earlier quoted context omitted.

That might work until there's somebody who uses double negation !! for some reason. But this might only be common in JavaScript, so YMMV.

I had to google this to see why on earth you would use double negation. Apparently it's a way to negate and convert to boolean.

Yes, it's one of those dirty JavaScript tricks that abuse type conversion. Negation converts anything into a boolean, so if you negate that again, you get the equivalent of converting the into a bool. In standard (old) JS fashion, it's both slower and less readable, but people still (used to?) do it. Similar hacks include 1* for num->string and +"" for the opposite, along with several others that I have luckily managed to forget.

Re: Dev Fonts

#274
post #257

Earlier quoted context omitted.

I'm not clear on the outcry against ligatures. This is a client-side setting and not committed to code, is that right? If so, this is like prescribing that we should use dark-mode over light-mode because I like it. Now during the pandemic we might screenshare more often so I can disable it for that, but for development on my own time on my own screen it's nonyabizness.

I was going to complain about them because there are a few fonts there I like a lot, but not the ligatures. Wasn't sure if it was = or == or === in the samples.

You can disable the ligatures for all those fonts and only see =, ==, === explicitly.

Re: Dev Fonts

#275
post #78

My favourite monospaced font is Triplicate https://practicaltypography.com/triplicate.html >: the only true serif monospace that I know of (though I have a vague feeling I found one other at some point). Every other serif monospace I know of is a slab serif. Triplicate’s variable stroke thickness is also exceedingly rare in monospaced fonts; almost everyone goes for uniform stroke thickness, as is customary with sans…

Personally, my eyes and brain just can't scan ligatures in code efficiently, I have to double read the code, especially "is that =, ==, or ===? Oh, and that's !==" (edit) I'll additionally qualify my comment, from a mathematics background I can casually scan a handwritten "!=" which is the same as the ligature, but I just cannot retrain my adult brain to accept the ligature version which is the same as the handwritte…

Seconded. I get it for math but, it's just super confusing in code. Like, most of us agree "there should be one obvious way to do it" in code. Why don't we think the same about what code looks like? That feels much more fundamental.

Obligatory digraphs/trigraphs reference: https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C

Re: Dev Fonts

#276
post #120

I don't see ligatures solving any important problem. If you think they do, I'd rather change syntax highlighting to recognize !== and others as a single token . It's like multi-select in text editors. When you think about it, it's actually an inferior form of search&replace. Inferior because it interacts badly with off-screen matches. I find arguments of kakoune users unconvincing. My personal opinion is - and I'm fi…

> I don't see ligatures solving any important problem.

I see ligatures as solving, imperfectly, the problem of "my language has clumsy operators because it wasn't designed with support for unicode operators" lining up with the preference of "I prefer less-clumsy operators".

If you don't have the first problem then, even if your language also supports ASCII multicharacter operators, its just an autoformatter issue.

Aside from the ambiguity with similarly-appearing genuine single characters, programming ligatures tend to not really solve the problem they set out to in monospaced fonts, where you end up with a single symbol which invariably preserves the width of the ASCII multicharacter symbol, which either introduces extra empty space or extra visual weight or, often, both.

> My personal opinion is - and I'm fine taking negative karma for this - that ligatures mostly appeal to the front-end developers among us.

I've seen more praise for them from corners of the Haskell/Idris community than from the much larger front-end community. I don't think there is any real correlation between working in front-end and preferring fonts with ligatures.

Re: Dev Fonts

#277

Am I the only one who uses a proportional font for coding? I find it more readable for the same reason it's more readable in books and other printed media.

> Am I the only one who uses a proportional font for coding?

No, I do it too.

> I find it more readable for the same reason it's more readable in books and other printed media.

OTOH, its really annoying when you edit code from someone who decided to try to "beautify" code by using alignment beyond indentation.

Re: Dev Fonts

#278
Thank you. Scratches my itch at this particular time, but as a guy who spends a lot of time with monospaced fonts in a code editor this is turning and to be a much more important resource than I thought.

Re: Dev Fonts

#279
post #226
post #78

Earlier quoted context omitted.

Personally, my eyes and brain just can't scan ligatures in code efficiently, I have to double read the code, especially "is that =, ==, or ===? Oh, and that's !==" (edit) I'll additionally qualify my comment, from a mathematics background I can casually scan a handwritten "!=" which is the same as the ligature, but I just cannot retrain my adult brain to accept the ligature version which is the same as the handwritte…

Not for comparison, but for boolean checks I prefer to use `foo == false` instead of `!foo`, the latter is easy to overlook.

I've recently started using a kind of middle ground by putting spaces around the !. Makes it harder to miss without losing the "reads like text" property that's lost when using == false.

if ( ! isLast(e) ) reads perfectly, especially since my native language doesn't insert the "not" im the middle like english does and my brain is used to that. if (isLast(e) == false) just jolts me out of that state where code reads as fluently as text. YMMV, of course, and I have a suspicion that your native language might play a role in that...

Post reply on HN