Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
StavrosK
5y ago
0 comments
Save
Share
Fields are messy because you have to check for nulls, yet JSON keys aren't messy because you have to check for nulls?
0 comments
2 comments · 1 top-level
top
newest
oldest
alanfranz
5y ago
· 1 in thread
All json keys are optional, so you ALWAYS need to check for their presence or absence. Mess exists when some key is nullable and some isn't. Checking for nullability on a key that can never be null isn't extremely elegant.
StavrosK
OP
5y ago
Why is that a mess? I don't see the difference.
j
/
k
navigate · click thread line to collapse