News for hackers. Stuff that matters.
Re:Ask HN: Why not use variable-width fonts for programming? by tlb on Thursday February 06, 2014 @06:41PM (#7193709)
I've tried it and didn't like it. You often have successive similar lines with slightly different identifiers, and if they don't quite line up it's visually jarring. A graphics example:

      var p0X = lo.convWeekToX(0);
      var p0Y = lo.convFlowToY(m.rev0);
      var p1X = lo.convWeekToX(0);
      var p1Y = lo.convFlowToY(m.exp0);
      var p2X = lo.convWeekToX(m.breakevenWeek);
      var p2Y = lo.convFlowToY(m.breakevenFlow);
      ctx.moveTo(p0X, p0Y);
      ctx.lineTo(p1X, p1Y);
      ctx.lineTo(p2X, p2Y);
That, rendered in a font where X, Y and Z aren't the exact same width, makes you want to scratch your eyeballs out:

. var p0X = lo.convWeekToX(0);

. var p0Y = lo.convFlowToY(m.rev0);

. var p1X = lo.convWeekToX(0);

. var p1Y = lo.convFlowToY(m.exp0);

. var p2X = lo.convWeekToX(m.breakevenWeek);

. var p2Y = lo.convFlowToY(m.breakevenFlow);

. ctx.moveTo(p0X, p0Y);

. ctx.lineTo(p1X, p1Y);

. ctx.lineTo(p2X, p2Y);

There are no comments on this comment yet.