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…
Dev Fonts
311–320 of 342 posts
Re: Dev Fonts
#312My 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…
Re: Dev Fonts
#313Re: Dev Fonts
#314Earlier 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
Of course not
Re: Dev Fonts
#315There'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.…
Re: Dev Fonts
#316Re: Dev Fonts
#317Luculent, my favorite: http://eastfarthing.com/luculent
Re: Dev Fonts
#318Earlier 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?
This is a much more readable cast.
Re: Dev Fonts
#319Earlier 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 :)
(eta: didn't finish the thought - I'd assume SQL influenced Excel, since it's older.)
Re: Dev Fonts
#320Earlier 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?