Dmitry A. Soshnikov :

> The existential operator is a syntactic sugar to avoid long testing
> whether a property exists and only after that to apply it. This already
> is again used in CoffeeScript, so I'll show the examples:
>
> let street = user.address?.street

It seems useful for testing, but also it is a little bit cryptic code.
Personally I would not read code full with existential operators.
Could you provide use case of:

entity.getBounds?().direction?.x

In your code I don't think you will need from existential operator.

entity.getBounds().direction.x;

It will be enough and it is definitely easier for debugging. The
existential operators would be really helpful for feature detections.

Instead of question mark I prefer to use different property access
notation. For example:

entity->getBounds()->direction->x ;

It will solve the problem with the  ambiguous syntax.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to