On 2022-10-09 12:34:22 -0400, Avi Gross wrote: > I have seen programmers who have taken an elegant pipeline I have built > apart and made it into many lines of code reassignment the value of each > step to the same or different variables and other ways of lengthening or > obscuring my intent.
I have certainly done that (not with your code, AFAIK). The problem with
those beautiful one-liners is that they are really hard to debug. So if
I can't convince myself that they are correct just by reading them I
have to split them over multiple lines so I can add breakpoints or log
messages. Of course I could put it together again afterwards, but I
would argue that if I didn't understand it the first time it's probably
better to leave it in its more verbose and debuggable state.
Of course I have also done the opposite: Taken some messy and
complicated code and simplified it into a simple generator expression.
In fact I would say that I code tends to be shorter after I fixed a bug
than before.
> So although size may matter, so can sighs.
:-)
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | [email protected] | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list
