# Make \`this\` optional for private fields

**URL:** <https://es.discourse.group/t/make-this-optional-for-private-fields/2061>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [June 11, 2024, 1:53pm UTC](https://es.discourse.group/t/make-this-optional-for-private-fields/2061 "2024-06-11T13:53:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wrnrlr](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/wrnrlr/32/2119_2.png) [@wrnrlr](https://es.discourse.group/u/wrnrlr)\
**Post date:** [June 11, 2024, 1:53pm UTC](https://es.discourse.group/t/make-this-optional-for-private-fields/2061/1 "2024-06-11T13:53:56Z")

</div>

I was wondering if it was possible to make the `this` in front of fields and methods inside of a class optional.

This would mean adding some clauses to the grammer, but I can't think of a reason why it should not be possible.

The main advantage of this is that it would be shorter code.

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [June 11, 2024, 2:13pm UTC](https://es.discourse.group/t/make-this-optional-for-private-fields/2061/2 "2024-06-11T14:13:50Z")

</div>

No, we explicitly decided to never do that when the `#x in obj` syntax proposal was advanced.

---

<div class="post-metadata">

**Author:** ![wrnrlr](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/wrnrlr/32/2119_2.png) [@wrnrlr](https://es.discourse.group/u/wrnrlr)\
**Post date:** [June 11, 2024, 9:42pm UTC](https://es.discourse.group/t/make-this-optional-for-private-fields/2061/3 "2024-06-11T21:42:31Z")

</div>

This is fair I hadn't thought that far ahead yet.
