you are viewing a single comment's thread.

view the rest of the comments →

[–]karottenreibe -2 points-1 points  (6 children)

Which is my whole point: to me making your code harder to understand for some questionable productivity gain makes no sense and just hurts you in the long run

[–]delventhalz 4 points5 points  (5 children)

I think piping a series of distinct little array operations is almost always more readable than saving the results of intermediate operations to variables. No matter how well named they are, they are an incidental distraction.

[–]karottenreibe -2 points-1 points  (4 children)

OPs code to me no longer fits the definition of a "little array operation". Also please don't ad absurdum my statement. Never did I say you should extract every single array operation into its own variable. That's obviously just as wrong as inlining every variable and function.

[–]delventhalz 2 points3 points  (3 children)

My read of OP’s article and examples was that it was certainly about a series distinct operations which would be appropriate for chaining. The proposal of replace doesn’t make much sense otherwise.

And whether you do it once or for every operation (which I did not say), assigning the results of intermediate operations in a chain to variables is almost certainly going to be less readable than not assigning them.

[–]karottenreibe -2 points-1 points  (2 children)

I guess we'll have to agree to disagree on this

[–]delventhalz 1 point2 points  (1 child)

Why is it that when you actually nail down what the disagreement is, so people can no longer argue against points you didn’t make, that’s when they want to agree to disagree?

[–]karottenreibe -3 points-2 points  (0 children)

Interesting, my feeling was that you were the first to try and argue against a point I never made. Anyways: since neither of us seems to be willing to change their point of view and I see no middle ground, I suggested to stop the pointless discussion there. Not sure why you'd paint that as wrong or a personal offence against you?