is there really a reason to use monospace fonts for code editing or is it just tradition at this point
@h I find with some languages it really helps structure things properly, but for other languages its just a tradition that should really be abandoned.
Imo when a language works with non-monospace fonts its really just better than monospace.
@h my code editor should use arial and parse and display everything as markdown. great idea get this to the investors
@aleteoryx indents would always be the same width though, its not like some tab character at the start of a line will be less wide than some other tab character at the start of a line. indents at the same level would stay lined up
@h makes dots and semicolons and stuff more legible . also ides used to be in the germinal where eveything gotta be monospaced because it got cool tables and colums and shit
@h@social.besties.house i wont lie i found this image to make a point, but this goes hard as fuck we should all do this actually .
@h@social.besties.house i keep meaning to try out a polyspace font (im sure that's not the term, but it's fun) in my editor. it sounds like it'd be quite an adjustment, but i know at least one person who uses it, i think exclusively
@h@social.besties.house it makes navigation between lines slightly more predictable as it's always exactly up or down and never "up and like half a char to the right and then if I go down it should take me to a different place but since I just came here actually the editor will remember that the inverse nav should take me to my starting point"
and then this invariant is violated by inline hints anyways. besides this I can't really think of any good reason other than tradition, which obviously started in terminal.
I guess it's more legible what's a combined ligature vs distinct characters just by the width. but when this matters it should just already be distinct without having to distinguish widths.
@h @shroomie if you want to make cool diagrams in your code comments, then monospace is a must. line up the start of code comments across lines (even if the first line has code before the comment) and then also line up whatever tables or such in the comment text.
monospace code font is important if you want to have a code comment that points at a piece of code, such as explaining what a parameter to a function means in a code example. think rustc error spans, but written by a human. some language has a testing framework like that (based on code comments pointing to code spans), I don’t know if it’s Rust, it might’ve been like F# or Raku I’m thinking of.
you’d also want to line up like, things that are a single expression but separated over lines. so method call chaining. array literals. arrays are mostly covered by having consistent initial indent but method calls often begin with an initial expression that maybe doesnt get a distinct line, so the indents must line up with whatever else is there. some formatters just don’t care though and add a standard level of indent making the first one misaligned anyway. it’s ugly.
for repeated things of fixed-length naming, which are convenient for various technical reasons especially concerning simplified serialization (i.e. no dynamic buffer size to serialize its name; be that for debug prints or persistent storage), but mainly for human readability. in such a case, the human benefits are only realized with a monospace font because a fixed-length name doesn’t benefit humans unless the rendered width is fixed as well. think here like lat,lon,alt
, x,y,z
, rot,pos,vel
. these are common triplets of names. you can even have a block of 9 lines maybe serializing whatever.{rot,pos,vel}.{x,y,z}
and in that case it would be painful to read if those didn’t align.