MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/tez3se/yes_if_you_use_array_reverse_like_this_it_only/
r/badcode • u/clemesislife • Mar 15 '22
6 comments sorted by
19
No, this will later be used to be removed so it can prove you worked very very hard on optimizations. Think ahead, overcome
6
Why does PHP suck? Because it’s got over a dozen sort functions, none of which are stable, all which mutate their input and don’t return the list as a value.
3
So many reverses
This code not only doesn't make any sense, it also shows that author didn't read the docs: array_reverse doesn't do that by reference: https://www.php.net/manual/en/function.array-reverse.php
array_reverse
5
The worse part is the 1700 lines in a single file
5 u/Food404 Mar 16 '22 At my work, there's a file of 8k LoC
At my work, there's a file of 8k LoC
19
u/Cristichi wicked Mar 15 '22
No, this will later be used to be removed so it can prove you worked very very hard on optimizations. Think ahead, overcome
6
u/varsderk Mar 16 '22
Why does PHP suck? Because it’s got over a dozen sort functions, none of which are stable, all which mutate their input and don’t return the list as a value.
3
u/SomeOtherGuySits Mar 15 '22
So many reverses
3
u/zmitic Mar 20 '22
This code not only doesn't make any sense, it also shows that author didn't read the docs:
array_reversedoesn't do that by reference: https://www.php.net/manual/en/function.array-reverse.php5
u/IIDaFuQII Mar 15 '22
The worse part is the 1700 lines in a single file