


If you break the CQS...

Potential problems:
Unclear whether functions have side effects.
Function names are often deceiving: functions do more than they say.
Violations of Single Responsibility Principle.
Temporal couplings: the order in which you call functions with side effects matters. 2/3





Example: popping the top element of a stack. The "pop" function removes one element and returns it. Therefore, it modifies the state of the stack and returns a value. 3/3