Isn't the whole point of monospaced fonts columnar alignment (e.g. the table in the article)? Seems like "almost" defeats the point. Then again, I don't see values lined up much these days: { "someKey": "someValue", "someOtherKey:" "someOtherValue, and if you only care about leading whitespace (that is, the whitespace before a character appears on the line), maybe it doesn't matter how your font is spaced. I suspect…
I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Only rarely is the vertical alignment useful because mostly code isn't read vertically. Used in moderation, the reverse Christmas tree style used in the Linux kernel can be as good for readability (…
Almost monospaced: the perfect fonts for writing
101–110 of 174 posts
Re: Almost monospaced: the perfect fonts for writing
#102Earlier quoted context omitted.
In circumstances, and depending on configuration, the code formatter tool may still aim for alignment, such as assignment operators on subsequent lines. Whether you like that or not, for me the question still stands: how does that jive with "almost monospaced".
I've been using proportional fonts in programming for about ten years. I stopped doing things like abc = 1 d = 2 which add very little readability value IMHO. Things like func(arg1, arg2, arg3) usually don't align well because func( has a different width than the five spaces in the lines below. However 1) my text editor (emacs) aligns those lines for me (probably any programmer's editor does) so at least I don't have…
Re: Almost monospaced: the perfect fonts for writing
#103Earlier quoted context omitted.
I've been using proportional fonts in programming for about ten years. I stopped doing things like abc = 1 d = 2 which add very little readability value IMHO. Things like func(arg1, arg2, arg3) usually don't align well because func( has a different width than the five spaces in the lines below. However 1) my text editor (emacs) aligns those lines for me (probably any programmer's editor does) so at least I don't have…
Formatting your code in an unintuitive way because of the font is a code smell to me.
Re: Almost monospaced: the perfect fonts for writing
#104Earlier quoted context omitted.
In circumstances, and depending on configuration, the code formatter tool may still aim for alignment, such as assignment operators on subsequent lines. Whether you like that or not, for me the question still stands: how does that jive with "almost monospaced".
I've been using proportional fonts in programming for about ten years. I stopped doing things like abc = 1 d = 2 which add very little readability value IMHO. Things like func(arg1, arg2, arg3) usually don't align well because func( has a different width than the five spaces in the lines below. However 1) my text editor (emacs) aligns those lines for me (probably any programmer's editor does) so at least I don't have…
if (condition...
&& condition...
&& condition...
) {Re: Almost monospaced: the perfect fonts for writing
#105Earlier quoted context omitted.
I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Only rarely is the vertical alignment useful because mostly code isn't read vertically. Used in moderation, the reverse Christmas tree style used in the Linux kernel can be as good for readability (…
> I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Seems wrongheaded to me; that's the same reason Elm wanted you to write arrays like this: [item1 ,item2 ,item3 ,item4 ] instead of a sane way. It means adding or removing an element only changes o…
[ item1
, item2
, item3
, item4
]Re: Almost monospaced: the perfect fonts for writing
#106Earlier quoted context omitted.
I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Only rarely is the vertical alignment useful because mostly code isn't read vertically. Used in moderation, the reverse Christmas tree style used in the Linux kernel can be as good for readability (…
The value of alignment (at least for me) is not in making the text of the code more readable. Instead, the value is communicating the structure of the code. Seeing the same shape repeatedly tells me a lot about what is happening. It also helps highlight changes between two lines that are very similar.
I agree and I think that is the same thing as code-readability. Code-readability means you can easily understand the code.
I personally try to abide by what I call "hedge" formatting convention, the punctuation forms a vertical hedge which then shows the structure of your code clearly:
[ a
, b
, c
]
Moving my eyes down to look for the closing bracket is easier (to me) than moving my eyes from left to right to spot it somewhere on the right side of the page.
Note how above ALL the punctuation is in the same (first) column, Having read that it then becomes easier to read what is on the rest of the columns.
In general it helps when things that are the same, or have the same purpose, on each line are in the same horizontal position. It is is then easier to see what is different about each line, since it is easy to see what is the same.
Re: Almost monospaced: the perfect fonts for writing
#107For me the lower L and the number 1 have to be different. Most mono fonts make them almost identical.
Typing “lst” looks like 1st (First). They either need to curve the bottom of the lowercase “L” or remove the bottom bar of the one.
Re: Almost monospaced: the perfect fonts for writing
#108Isn't the whole point of monospaced fonts columnar alignment (e.g. the table in the article)? Seems like "almost" defeats the point. Then again, I don't see values lined up much these days: { "someKey": "someValue", "someOtherKey:" "someOtherValue, and if you only care about leading whitespace (that is, the whitespace before a character appears on the line), maybe it doesn't matter how your font is spaced. I suspect…
I might give these fonts a try, although I've been used to Menlo for a long time.
Re: Almost monospaced: the perfect fonts for writing
#109Earlier quoted context omitted.
I stopped manually formatting code long ago, just accept what the code formatter tool decides is good enough. Saves a lot of time.
In circumstances, and depending on configuration, the code formatter tool may still aim for alignment, such as assignment operators on subsequent lines. Whether you like that or not, for me the question still stands: how does that jive with "almost monospaced".
Re: Almost monospaced: the perfect fonts for writing
#110Earlier quoted context omitted.
I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Only rarely is the vertical alignment useful because mostly code isn't read vertically. Used in moderation, the reverse Christmas tree style used in the Linux kernel can be as good for readability (…
> I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Seems wrongheaded to me; that's the same reason Elm wanted you to write arrays like this: [item1 ,item2 ,item3 ,item4 ] instead of a sane way. It means adding or removing an element only changes o…
[ a [ a [ a
, b , b / , b
, c --> , c / , c
, d , d / , dd
] , e ]
]
Your usual 3 way merge algorithm will correctly deduce: [ a
, b
, c
, dd
, e
]
Contrast this with trailing comma: [ a, [ a, [ a,
b, b, / b,
c, --> c, / c,
d d, / dd
] e ]
]
You now have a merge conflict between "d," and "dd".However, if you were to require a trailing comma after the final element you wouldn't have this problem.