4 ms·
Here's MySQL's all-session-globals-in-one-place-class: https://github.com/mysql/mysql-server/blob/8.0/sql/sql_class.h#L927 https://github.com/mysql/mysql-server
by Sesse__ 3y ago
Here's MySQL's all-session-globals-in-one-place-class: https://github.com/mysql/mysql-server/blob/8.0/sql/sql_class.h#L927 https://github.com/mysql/mysql-server/blob/8.0/sql/sql_class...
I believe I can safely say that nobody acknowledges and understands the complexity of all state within that class, and that whatever incentives there may be to simplify it are not enough for that to actually happen.
(It ends on line 4692)
- IshKebab 3y agoRight but that would still be true if they were globals instead. Putting all the globals in a class doesn't make any difference to how much state you have.
- Sesse__ 3y ago> Putting all the globals in a class doesn't make any difference to how much state you have. I didn't make any claims about the _amount_ of state. My claim was that “you're forced to acknowledge and understand the complexity of your state” (i.e., moving it all together in one place helps understanding the state) is plain-out wrong.
- IshKebab 3y agoIt's not wrong. Obviously putting it all in one place makes you consider just how much of it you have, rather than having it hidden away all over your code.