Re:Ask HN: Anyone using proportional fonts for coding?
by kazinator on Monday July 31, 2023 @07:09PM
(#36950119)
Another thing that doesn't work with proportional fonts:
function(arg1,
arg2,
arg3);
Note that this, and everything in my above comment, can work just fine with tabs used for indentation, and set to the developers' preference: [tab]struct netent {
[tab] char *n_name; // Official name of network.
[tab] char **n_aliases; // Alias list.
[tab] int n_addrtype; // Net address type.
[tab] uint32_t n_net; // Network number.
[tab]};
[tab]{
[tab][tab]function(arg1,
[tab][tab] arg2,
[tab][tab] arg3);
Change tab size, alignment is fine. Change to proportional font, it all goes haywire.
Re:Ask HN: Anyone using proportional fonts for coding?
by MathMonkeyMan on Friday August 04, 2023 @06:02AM
(#36997757)
We could give up on thinking of code as:
- a sequence of characters and spaces
- a series of lines
- a fixed grid of characters and spaces
Instead, store code as a parse tree -- comments and all. Then we'd view and edit code using "WYSIWYG" editors solely. No more "cat" and "less", we'd need new tools. No more tty-like terminals, we'd need something more like a web browser.
It would cripple existing workflows and hinder compatibility, but the advantage is that "formatting" would be the viewer's preference. Forget about tab stops and fonts; think more like CSS. It's an extreme version of the tabs people's argument.
Word/Sheets documents come close, in a horrifying way. What I'm describing is more like Graphviz.
Parallel definitions lined up for readability.
Similarly in structure definitions where there are line comments:C preprocessor continuation backslashes.
Alignment in parallel definitions. No, tabs will not fix this issue, unless everyone agrees on exactly the same font, and the same tab stops, in the same editor. What looks vertically aligned in your editor looks staggered in someone else's.This kind of thing is not unheard of:m
We have the identifiers of the declarators vertically lined up, but the pointer derivators hang to the left. Tabs will just not do this.Proportional font coders are in the lunatic fringe.
All else being equal, do not hire.