--

"Your article only focuses on object types that can't be different and that are under control of the project"

yes. you are right

(obj?.prop?.subProp?.method ?? () => {})()

is not better than:

obj.subPropMethod()

the above violates demeter' law and has nulls.

Therefore is worse than the latter, IMHO

--

--

Maximiliano Contieri
Maximiliano Contieri

Written by Maximiliano Contieri

I’m a senior software engineer specialized in declarative designs. S.O.L.I.D. and agile methodologies fan. Maximilianocontieri.com

Responses (1)