1006
PHP is dead? (telegra.ph)
submitted 1 year ago by sag@lemm.ee to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] Bigworsh@discuss.tchncs.de 5 points 1 year ago

Simply because it was an issue that I ran into at work. And the reason I focus on arrays is because of the previously mentioned default behaviour of arrays being cloned when passed as an argument for a function. The issue here was someone unexperienced wrote a bunch of code and used only arrays (deep ugly arrays) and it ended up being a huge mess of some references staying the same while others changed. So the only solution was to deep copy at one place. That way later operations on these arrays didn't affect the original structure. Not pretty but refactoring would have been too much effort.

this post was submitted on 30 Oct 2023
1006 points (96.1% liked)

Programmer Humor

32426 readers
986 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS