4 ms·
Can still have internal state.
by ajuc 4y ago
Can still have internal state.
- ehnto 4y agoI suppose, but that's if you build it that way. A 'pure' function can also have state if you pull it in through global vars or other functions. Writing stateless code has to be deliberate no matter which method you use.
- tedmiston 4y agoHow can a purely static class have internal state if there's no instantiation of the class or instance variables? Are you referring to variables declared on the class directly? If so, that feels analogous to a function potentially having module-level state variables to me, in Python for instance.