Live data from Hacker News

Dev Fonts

devfonts.gafi.dev

311–320 of 342 posts

Re: Dev Fonts

#311
post #249

Earlier quoted context omitted.

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

As I'm not keeping up with recent progress of the language, how would you do that today?

Re: Dev Fonts

#312

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…

I like the true italics - they remind me a bit of the Light Italic typeface on the IBM Selectric (which has been discussed recently on HN I think.) IBM developed a number of beautiful and legible typefaces for its typewriters and I'd love to have them all as screen fonts.

Re: Dev Fonts

#314
post #226

Earlier quoted context omitted.

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

> Do all languages have ...

Of course not

Re: Dev Fonts

#315
post #236

There's a certain style of programming font, I think due to narrow strokes and sharp curves that I at least find universally ugly and often hard to read. From this list Monoid, Iosveka, Anonymous Pro, and Share Tech Mono at least fall into that category. I think it's meant to be sort of a callback to bitmap fonts? I know the Linux console font (terminus) looks similar, but that's clearly due to technical limitations.…

I still haven't found a font I like better than Terminus. I've tried scores and keep coming back to it. I find most fonts to take up way to much horizontal space compared to Terminus. I might try a couple of those just to see, but I'll probably just end up back on Terminus.

Re: Dev Fonts

#318
post #311

Earlier quoted context omitted.

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

As I'm not keeping up with recent progress of the language, how would you do that today?

If x is your variable, you can just do Boolean(x) rather than !! to make it boolean. E.g. it will convert undefined, null, 0, "", and NaN to false.

This is a much more readable cast.

Re: Dev Fonts

#319
post #282

Earlier quoted context omitted.

I've never had to use JavaScript, but I've done the *1 or &"" in Excel to force conversion to the desired type... yes, let's mercifully lay the veil of forgetting over this.

Considering Excel's offical way of writing a != b is a b, I think these kinds of hacks there can be excused :)

ab is the preferred syntax in SQL. I'm pretty sure a!=b works everywhere these days, but that hasn't always been the case.

(eta: didn't finish the thought - I'd assume SQL influenced Excel, since it's older.)

Re: Dev Fonts

#320
post #294

Earlier quoted context omitted.

As far as serif monospace, NSimSun is still my favorite. It's in Windows. I love Triplicate but can't bring myself to purchase yet. I like Equity, too. I think Triplicate is the closest to the old Selectric Prestige font, which I loved. But if anyone has NSimSun replacements (paid or free), please let me know.

Equity, a mono serif? Where do you find that one?

Equity is being mentioned as another of Matthetw Butterick’s fonts—a serif, not a monospaced font.
Post reply on HN