A short reflection on how code comments should ideally be wrapped to a different column than surrounding code, with the comment content width being relative to the comment's indentation level. The author argues for wrapping code at 100 columns but comment content at 70 columns (relative to the comment start), noting this isn't well-supported by current tools like the VS Code Rewrap extension or Emacs M-q. The post also touches on why hard-wrapping is preferable to soft-wrapping for comments, since correct soft-wrapping requires understanding the text's semantic structure (e.g., markdown lists).

2m read timeFrom matklad.github.io
Post cover image

Sort: