When Getters and Setters Outlive Their Purpose
Why is this CodeQuality meme funny?
A True Detective–style line brands mechanical getters and setters as a maturity problem. The dive explains encapsulation versus public fields in disguise, justified accessors, and when domain methods should protect invariants instead.
Read the full deep dive →Description
On a black background, large white text reads, “Past a certain age, a man who still writes getters and setters can be a bad thing”. Below it, a rounded-corner television still shows Woody Harrelson’s suited detective character seated in a glass-walled office, leaning back and gesturing with both hands as if delivering a grave judgment. The meme applies the solemn True Detective format to routine object-oriented boilerplate, mocking developers who mechanically expose every field through trivial accessor methods. Its technical point is that accessors provide little encapsulation when they add no validation, invariant, abstraction, or behavior.
Comments
1Comment deleted
A trivial getter/setter pair is just a public field wearing enterprise business casual.