DEV Community

loading...

Discussion on: 😲🀯The most outstanding new feature in Javascript you need to know about: Optional Chaining

Collapse
carlillo profile image
Carlos Caballero

I think that the chaining operator is a patch when you're not satisfying the law of demeter.

My post about Demeter's law on Dev.to (dev.to/carlillo/demeters-law-dont-...).

What do you think about that?

Collapse
lampewebdev profile image
Michael "lampe" Lazarski Author

Yes, I'm on your side here!

the ?. is a patch around bad object and API design.

Having this deeply coupled and tightly integrated objects is never a good thing.

The problem is that you can not always control what data you are getting.

Another problem is that NoSQL databases promote deeply nested objects and then they don't provide any schema mechanisms. This was always a strange thing coming from SQL where Schemas were the norm.

But yeah nice article!

Collapse
carlillo profile image
Carlos Caballero

Thanks for your opinion 😊

Thread Thread
lampewebdev profile image
Michael "lampe" Lazarski Author

Your welcome πŸ˜€πŸ‘