The problem might be that we have most likely not yet handled the edge case situation where a.b and a.b.c doesn't exist. And just want to log out the value, and print undefined if it doesn't exist.
Ruby has had this kind of syntax since forever and it's one of the things that people love about it.
> The problem might be that we have most likely not yet handled the edge case situation where a.b and a.b.c doesn't exist
That's not an edge case, that's an expected case. If it doesn't exist, nothing is supposed to happen.
OOP just obfuscates this basic fact of programming life to the point where it's not obvious anymore. That is not a good thing, it's a huge waste of time. Favor plain data over "objects" and functions over methods. Favor plain SQL queries over ORM.
Depending on the language, `a.b && ...` could be checking either or both of the following:
- does `a` have key 'b'? - is `a.b` truthy?