logoalt Hacker News

AgentOrange1234today at 4:00 AM4 repliesview on HN

In programming certain word choices are valuable in this way. It's sad that pairs like true/false, good/bad, first/rest, and left/right are unequal length. But there are nice pairs like old/new, head/tail, fast/slow, same/diff, and right/wrong, which can help with create natural vertical alignment throughout a function.


Replies

pmontratoday at 5:16 AM

Ah, but I use a normal proportional font in my editor so same and diff have different widths.

That was the fun comment. The serious ones:

1. I'm trading the ability to align statements on consecutive lines for a more pleasant reading experience.

2. Nobody ever complained that my source code is

  a = 1
  ab = 2
  abc = 3
instead of

  a   = 1
  ab  = 2
  abc = 3
3. No tables or diagrams in comments of course but I think that I could configure my editor (emacs) to use a monospaced font there. I do use a monospaced font for the ``` ``` blocks of md files.

4. I'm using Atkinson Hyperlegible Next https://www.brailleinstitute.org/freefont/

CarVactoday at 4:26 AM

Row/col works but width/height doesn't, alas.

show 1 reply
thaumasiotestoday at 4:55 AM

> It's sad that pairs like true/false, good/bad, first/rest, and left/right are unequal length.

You're just matching them wrong. On/off and yes/no may look unequal, but what about yes/off or on/no?

show 1 reply
nullsanitytoday at 5:04 AM

[dead]