Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/external/historical/nawk/bin



On Mon, Jul 04, 2022 at 08:04:57 +0200, Roland Illig wrote:

> 04.07.2022 01:54:16 Valery Ushakov <uwe%stderr.spb.ru@localhost>:
> > On Mon, Jul 04, 2022 at 00:07:23 +0200, Roland Illig wrote:
> >
> >> Am 03.07.2022 um 21:55 schrieb Valery Ushakov:
> >>> On Sun, Jul 03, 2022 at 10:56:22 +0000, Roland Illig wrote:
> >>>
> >>>> Module Name:    src
> >>>> Committed By:   rillig
> >>>> Date:       Sun Jul  3 10:56:22 UTC 2022
> >>>>
> >>>> Modified Files:
> >>>>     src/external/historical/nawk/bin: awk.1
> >>>>
> >>>> Log Message:
> >>>> awk.1: remove trailing space in output of 'echo' example program
> >>>
> >>> This is cure worse than the desease.  Please revert.
> >>
> >> Why is it worse?
> >
> > It's ugly
> 
> Why is it ugly?
>
> > and complicated (for an example),
> 
> Why is it complicated? It's still only 3 lines of code.
> 
> > it obscures the point this example tries to make.
> 
> What is this (single?) point this example tries to make? To me, it
> was how to write a BEGIN program that uses ARGV, and my rewritten
> code still illustrates this.

You have turned a trivial for loop that requires no mental bandwidth
to skim over into a code review errand with complex case analysis and
ugly inverted 1 < ARGC to boot.

I realize this is de gustibus and if you don't see this new code that
way I probably cannot make you see it that way, but this case is not
about code doing something specified with aesthetic considerations
being secondary to its actually doing the job.  Here taste is an
important factor b/c it's not code, but a man page - a literally work
really.


> > The point is not to write a perfect echo(1) clone in awk.
> 
> If that had been my goal, I would have implemented the -n option as
> well, at which point the code would have grown large enough to be
> extracted into a separate file. I didn't do that though.

Well, what *was* your goal?  To be "technically correct, the best kind
of correct"?

I'm pretty sure that whoever wrote that example did know how to write
a "proper" echo in awk, but chose not to deliberately.


-uwe


Home | Main Index | Thread Index | Old Index