>>That main function is good, standard style. > >Unnecessary goto, variables defined far away from where they are used, >monster function, variables are not commented what they do, not all >functions are commented what they do.. > >To me, it looks like that there is no intention to optimize readability and >testability. Instead it looks like there is put effort to minimize amount of >functions or something. > >>It has one small getopt(3) loop, decrements argc/argv, has one small >>codeblock to handle arguments for each variant of the utility, and >>one concise fts(3) main loop to handle files, and finally a one-liner >>for error handling. > >It would be better if they all are put to separate functions. That is >the whole point in functions, to put task to single program fragment. > >>So what's the point? You can't *calculate* whether something is >>readable for a *human*, and that's what matters. > >There are measured human factors, example size of working memory. >If there is measured magic constants, it is possible to calculate what >is somewhat better or worse. > >Something to aim for: >-Less linearly independent paths in module >-High cohesion >-Low coupling > >These are basics. It also matters a lot for testability. Less >independent paths means less test cases.
It really sounds like you could be more useful elsewhere. Like maybe helping to improve GNU echo.
