Re: [dev] [st] [PATCH] Correct shift amount on MODE_INSERT in tputc()

From: Rian Hunter <rian+suckless-dev_AT_thelig.ht>
Date: Fri, 30 Jan 2015 13:32:16 -0800

On Fri, Jan 30, 2015 at 08:14:59PM +0100, FRIGN wrote:
> On Fri, 30 Jan 2015 09:53:41 -0800
> Rian Hunter <rian+suckless-dev_AT_thelig.ht> wrote:
> > I'd really appreciate it if there were a longer comment detailing how
> > word wrap, auto newline insertion, and overflow handling are supposed to be
> > handled in st.
>
> Hehe, a few comments here and there would definitely be helpful. But much more
> important is writing code in a way that it speaks for itself.
> In cases it is not, comments should be added.

Just to clarify, I'm not generally advocating for more comments. I think this
is one of those cases where a good high-level overview is necessary. Within st,
word-wrap and newline handling is a larger algorithm with code scattered across
various data structures, state machines and functions. The code alone
is too microscopic to communicate the larger intent.

Even with a perfect understanding of what the existing code does, it's not
clear in this case what the code is intended to do. For an outsider this
makes definitively fixing the bug much harder and possibly error-prone.
Received on Fri Jan 30 2015 - 22:32:16 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 30 2015 - 22:36:07 CET