"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: tree view page up/down bugs
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 29 Nov 2020 23:55:01 +0100

Download raw body.

Thread
  • Christian Weisgerber:

    tog: tree view page up/down bugs

  • On Sun, Nov 29, 2020 at 05:16:30PM +0100, Christian Weisgerber wrote:
    > I'm hesitant to give this sort of backseat commentary, but various
    > display-related functions in tog.c take an awful lot of parameters
    > that are actually redundant.
    
    tog.c is ugly in several ways. For example, some code sections use a
    random mix of 'goto' and 'break' statements which effectively jump to
    the same line. A lot of code sections have been copied and then modified,
    and most duplicated logic was never extracted and unified again. 
    
    tog was a copy-paste mess from the very beginning. It was initially written
    as an interactive demo to show capabilities of the code in lib/libexec.
    I paid more attention to the quality of the library code since that was
    my main focus at the time.
    
    Everyone, please feel invited to help with tidying up tog.c by eliminating
    duplicated code sections and redundant helper functions that are called only
    once, reducing function parameter lists, and generally making things more
    consistent. This can be done incrementally with small patches here and there.
    I might also go over tog.c soon in order to make some cosmetic changes.
    
    
    
  • Christian Weisgerber:

    tog: tree view page up/down bugs