Skip to content
DevMeme
7512 of 7540
When Getters and Setters Outlive Their Purpose
CodeQuality Post #8233 · source on Telegram

When Getters and Setters Outlive Their Purpose

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

1
Anonymous ★ Top Pick A trivial getter/setter pair is just a public field wearing enterprise business casual.
  1. Anonymous ★ Top Pick

    A trivial getter/setter pair is just a public field wearing enterprise business casual.

Use J and K for navigation