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

Re: cat and pipelines, mostly (was Re: Delete all after a pattern)



On 2019-08-31 at 11:56, Roberto C. Sánchez wrote:

> On Sat, Aug 31, 2019 at 11:38:59AM -0400, The Wanderer wrote:

>> Just because I only type the command once doesn't mean that I want
>> to type a more complex command than I need to.
> 
> Whereas I'd rather front-load the complexity for the repeated benefit
> of additional simplicity for every future occurrence.

If I thought that the result was usefully simpler, I might agree with
you. As seems to have become clear over the course of this conversation,
however, I see the result as more complex and harder to work with - so
naturally I choose differently.

>> I'm not sure exactly what optimizations, or benefit, you're
>> referring to. Aside from argument towards elegance, and possibly
>> performance optimization of some form, I'm not sure I see any
>> benefit of the forms you're suggesting.
> 
> To me, the benefit is in being able to quickly and unambiguously 
> separate "interesting" logic from "non-interesting" parts of the 
> command.  We obviously have different views on how this could be 
> beneficial or even what constitutes "interesting" vs.
> "non-interesting" parts.

Or even, and I think more to the point, what makes it easier vs. harder
to do that separation.

>> But I don't have to spend any time on separating the two. The
>> beginning of the command is where the input comes in; the end is
>> where it goes out; everything else is functional.
>> 
>> The form you provided that puts both at the end is complex and
>> confusing enough that I can't parse it at a glance; doing so only
>> takes me a second or two, but I do have to stop and do it, in what
>> I suspect is much the same way you have to stop and separate out
>> the functional from the input-handling in my preferred idiom.
>> 
>> Again, there's nothing wrong with your approach. What I'm saying is
>> that there's also nothing wrong with mine, and yet I get called out
>> for using (or even suggesting) it, for what as far as I can tell
>> are purely historical reasons.
> 
> In my case I have trained myself to quickly parse the form I
> described. Those extra characters and constructs, which some might
> argue are visual clutter, are to me clean separators between the
> parts I can safely ignore and the parts where I should focus my
> effort.

With enough practice, I might reach the same state.

I just don't see any sign that the end result would be enough of an
improvement over where I am now to be worth investing that practice.

I can already separate things cleanly enough - in my own way and with my
own preferred idiom - that the ability to do so wouldn't be something
gained by the process, so that part's a wash.

There are various small advantages and disadvantages on each side, which
might weigh in one direction or the other or might balance out, but
certainly don't seem to weigh heavily enough in favor of the other side
to counterbalance the bother of developing the skill to let me use your
preferred idiom as easily as you can.

> In any event, I agree that there is nothing inherently wrong with
> your approach, though I would find it more difficult to effectively
> reason about the start of the "interesting" part of a command in your
> preferred construct.

I can kind of see how in the abstract, but in practice I just don't get
it; that's where it seems the most clear that our minds work
differently, because the way I do it seems so intuitive to me that it's
basically no barrier at all to (as you put it) reasoning effectively
about that.

>> I could try to break apart and analyze my reasons at length, but I
>> kind of doubt that the result would be all that productive.
> 
> It might not be for us, but you may find it useful to do that for 
> yourself.

True! I'm not sure I haven't already done that, but going over it again
couldn't hurt. I'm not especially inclined to do it in public writing at
present, however.

>> I can see the argument for clutter, but for my purposes, the extra 
>> syntax of the forms you've suggested are even more clutter and make
>> the result even harder to read, thereby making it even harder to
>> quickly discern what is really happening.
>> 
>> I suspect that this just boils down to minds working differently.
> 
> True.  Over time my thoughts on what constitutes clutter, easy to
> read code in various languages, etc. has changed.  Looking back over
> old code that I've written years ago is a real treat.
> 
> I have actually found myself saying things like, 'what moron wrote
> this garbage?!?!'  Then looking at the git history to find that the
> moron was me a few years ago :-)

I've done things like that a few times myself. ^_^

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: