[dev] less lines of code suck less

2021-05-03 Thread Greg Reagle
Would sbase suck less if the program head, which is currently a C program of 77 lines, were replaced with something like #!/bin/sh sed "$1"q I know that it would need to be a bit more elaborate than that to handle the -n flag, but still. Is there any advantage to having a separate C progra

[dev] Re: less lines of code suck less

2021-05-03 Thread Greg Reagle
I'm sorry I forgot to include this in my initial message. I found no difference in performance time or memory usage (with a small file), so that does not seem to be an advantage. And I am serious about this--I really want to know. Is there any good reason to have a separate C program? On Mon

Re: [dev] less lines of code suck less

2021-05-03 Thread Jeremy
On 05/03/21 04:28PM, Greg Reagle wrote: > Would sbase suck less if the program head, which is currently a C program of > 77 lines, were replaced with something like > #!/bin/sh > sed "$1"q > Great job. > I know that it would need to be a bit more elaborate than that to handle the > -n fla

Re: [dev] less lines of code suck less

2021-05-03 Thread Greg Reagle
On Mon, May 3, 2021, at 16:51, Jeremy wrote: > I'd argue that requiring awk to use `head` would create more > complexity(for the end user) than it would solve for the developer. I assume that you mean requiring head to use awk. I cannot imagine how it would have any effect at all on the end user

Re: [dev] less lines of code suck less

2021-05-03 Thread Greg Reagle
> Would sbase suck less if the program head, which is currently a C > program of 77 lines, were replaced with something like > #!/bin/sh > sed "$1"q Here it is in 37 lines of glorious rc shell code. Note that head.c also depends on several functions in libutil, so it is more than 77 lines

Re: [dev] less lines of code suck less

2021-05-03 Thread Hiltjo Posthuma
On Mon, May 03, 2021 at 04:28:47PM -0400, Greg Reagle wrote: > Would sbase suck less if the program head, which is currently a C program of > 77 lines, were replaced with something like > #!/bin/sh > sed "$1"q > No > I know that it would need to be a bit more elaborate than that to handle