ID as a Form of Primitive Obsession
kwstannard.github.io·7w·
Discuss: Hacker News

Primitive obsession: the act of utilizing language primitives like strings, integers, arrays, and such to represent complex domain objects. A common example of this is representing money with ints or floats. Primitive obsession tends to result in the spread of logic that could be cohesively contained in one file across the application, repetition of conversion logic through flows, and many strange hacks that slow comprehension.

A common issue I find across many organizations that is quietly hindering them is the utilization of identifiers inside of domain logic. Somewhat recently it hit me that this is a form of primitive obsession. Identifiers are strings or integers and they represent much larger domain objects, which qualifies them as a form of primitive obsession. Code that util…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help