re: Demystifying the Long Arrow "Operator" VIEW POST

re: seems like an excellent way to frustrate the hell out of future maintainers. the formatting is weird and the value you declared for your index is n...

The value for the index is used, it is just used in a confusing way.
This whole article is just an example of what NOT to do.

Also, realize that the post decrement actually happens AFTER the comparison to zero, which might not be obvious to someone as well. As you say, don't do this with code that someone else might have to maintain.


i should clarify, the problem that stood out to me is the initial value of the index is never used in the body of the loop. that's what makes this thing so awful. the loop "works", but then you're left chasing an off-by-one error.

Code of Conduct Report abuse