Re:Good thing in PHP nobody talks about
by fgheorghe on Monday August 27, 2018 @04:31PM
(#17854258)
Thats pretty much a bad practice well documented accross various php tutorials and books. But many php developers have no understanding of programming so they stash everything in that _SESSION superglobal or do other scary things.
[ Parent
| on HN ]
Re:Good thing in PHP nobody talks about
by throwawayjava on Monday August 27, 2018 @04:54PM
(#17854449)
Global state in general is bad practice well documented across tutorials and books about programming. Article's argument is that PHP avoids global state, but _SESSION hell and "MySQL table as global state" patterns demonstrate that programmers will always find a way to shoot themselves in the foot with global state :)
Also, IME even good PHP programmers suffer from the "MySQL-table-as-global-runtime-state" syndrome. And it's at least as bug-prone as storing global state in an ADT.