On 20/01/2023 19:48, Kamil Tekiela wrote:
I don't think it's such a huge issue as you make it to be. The
documentation states this only as an alternative:
https://phpspreadsheet.readthedocs.io/en/latest/topics/accessing-cells/#looping-through-cells-using-indexes

It also mentions the pitfalls. I doubt many users would prefer that
"alternative" given that the recommended way is simpler and does the same
thing.
I also don't think that performance would come into play here. Any
difference would be insignificant.
I believe that the benefits of the deprecation outweigh any potential extra
work the developers may have.

I beg to differ. Having done a lot of work last year recommending the deprecation of using of column indexes (1,2,3,etc) in favour of addresses ('A', 'B', 'C', etc) to more closely match with Excel's layout; and knowing how much the codebase uses alpha column incrementing internally, I'm aware of how much an issue it is.

I'd prefer if developers using PhpSpreadsheet used the built-in iterators, and Im in the middle of writing a post on the benefits of doing just that; but "under the hood" alpha column names are used, not numeric indexes'; so a lot of the "under the hood" code uses ++ and -- with row numbers and column addresses.


And replacing any PHP operator with a function call is always going to be less performant.


The benefits of this deprecation seem to be making ++ and -- consistent by making them little more than a syntactic sugar for numeric values only; I'm afraid I don't see that as a benefit; but as a retrograde step, and not the same as making ++ and -- consistent.


--
Mark Baker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to