Re: Drop a distracting function from locate(1)

2015-09-21 Thread Bob Beck
Holy bikeshed batman.. Did I accidentally stumble into a FreeBSD list?

Re: Drop a distracting function from locate(1)

2015-09-21 Thread lists
On Mon, 21 Sep 2015 07:47:55 +0200 Otto Moerbeek wrote: > On Sun, Sep 20, 2015 at 07:43:46AM -0400, Michael McConville wrote: > > > Otto Moerbeek wrote: > > > I do not agree. You only have to remeber "that function does sensible > > > error checking" and you do not have to remember at each spot

Re: Drop a distracting function from locate(1)

2015-09-20 Thread Ted Unangst
Michael McConville wrote: I'm late to the party, but we could tidy things up a bit by moving the function into the c file it's used in and using errx() internally. > Index: locate/fastfind.c > === > RCS file: /cvs/src/usr.bin/locate/

Re: Drop a distracting function from locate(1)

2015-09-20 Thread Otto Moerbeek
On Sun, Sep 20, 2015 at 07:43:46AM -0400, Michael McConville wrote: > Otto Moerbeek wrote: > > I do not agree. You only have to remeber "that function does sensible > > error checking" and you do not have to remember at each spot which > > condition is the right one. > > > > Function are the majo

Re: Drop a distracting function from locate(1)

2015-09-20 Thread Michael McConville
Otto Moerbeek wrote: > I do not agree. You only have to remeber "that function does sensible > error checking" and you do not have to remember at each spot which > condition is the right one. > > Function are the major way of structuring code, use them. It's not the idea of functions that I'm que

Re: Drop a distracting function from locate(1)

2015-09-20 Thread Otto Moerbeek
On Sat, Sep 19, 2015 at 05:57:23PM -0400, Michael McConville wrote: > > What's your thinking behind this? To me this seems like a perfectly > > rational and well motivated function to have, both for readability and > > rather than having to repeat the same statements several times over in > > the

Re: Drop a distracting function from locate(1)

2015-09-19 Thread Benny Lofgren
On 2015-09-19 23:57, Michael McConville wrote: >> What's your thinking behind this? To me this seems like a perfectly >> rational and well motivated function to have, both for readability and >> rather than having to repeat the same statements several times over in >> the rest of the code, risking

Re: Drop a distracting function from locate(1)

2015-09-19 Thread Tobias Stoeckmann
On Sat, Sep 19, 2015 at 05:57:23PM -0400, Michael McConville wrote: > If you're abstracting something into a function, it definitely shouldn't > be creating more code. Yet this shouldn't stop you from performing "divide and conquer". It's not just about reducing lines of code when abstracting logi

Re: Drop a distracting function from locate(1)

2015-09-19 Thread Michael McConville
> What's your thinking behind this? To me this seems like a perfectly > rational and well motivated function to have, both for readability and > rather than having to repeat the same statements several times over in > the rest of the code, risking future calamity if a change is made in > one place

Re: Drop a distracting function from locate(1)

2015-09-19 Thread Benny Lofgren
On 2015-09-19 20:29, Michael McConville wrote: > Index: locate/fastfind.c > === > RCS file: /cvs/src/usr.bin/locate/locate/fastfind.c,v > retrieving revision 1.12 > diff -u -p -r1.12 fastfind.c > --- locate/fastfind.c 16 Jan 2015 06:40

Drop a distracting function from locate(1)

2015-09-19 Thread Michael McConville
Index: locate/fastfind.c === RCS file: /cvs/src/usr.bin/locate/locate/fastfind.c,v retrieving revision 1.12 diff -u -p -r1.12 fastfind.c --- locate/fastfind.c 16 Jan 2015 06:40:09 - 1.12 +++ locate/fastfind.c 19 Sep 2015 1