Architecture & practice·Design, structure and tradeoffs
you called something that looked like a getter and it wrote a row to the database.
Command-query separation
Also calledCQS
A method should either change something or answer something, never both. When a query has a side effect, nobody can safely call it twice, log it, cache it or move it inside a conditional — all the things people do to a getter without thinking. The cost of ignoring it is a class of bug that only appears when someone removes a call they believed was a read.