Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use underscore prefix for private and internal fields #214

Open
Seb-stian opened this issue Jan 2, 2022 · 6 comments
Open

Use underscore prefix for private and internal fields #214

Seb-stian opened this issue Jan 2, 2022 · 6 comments
Labels
code-style Relates to code formatting and conventions priority: low Nice to have

Comments

@Seb-stian
Copy link
Member

Title says it all. This is to follow Microsoft conventions and remove all redundant this.es (I'm looking at you @Tides 👀 ).

What's everyone's take on this?

@Seb-stian Seb-stian added the code-style Relates to code formatting and conventions label Jan 2, 2022
@Tides
Copy link
Member

Tides commented Jan 2, 2022

I genuinely think even if it's minor detail that prefixing fields with _ is a sin 🙏

@Seb-stian
Copy link
Member Author

prefixing fields with _ is a sin 🙏

In that case...
image

@tacosontitan
Copy link

tacosontitan commented Jan 6, 2022

I believe prefixing fields with an underscore is a great idea!


@Tides,

I genuinely think even if it's minor detail that prefixing fields with _ is a sin 🙏

It's far from a minor detail though. It falls under the same reasoning we use to adhere to pascal casing for properties and camel casing for variables/fields. It tells you at a glance what you're working with. The reason the convention has shifted to prefixing fields with underscores is to distinguish between fields and local variables (e.g. _fieldName versus localVariableName), thus, making code easier to follow at a glance.


@Seb-stian, I'd like to work on this. I assume that the removal of this is going to be a separate issue?
Also, on a side note, this issue is probably a good candidate for the "good first issue" label since renaming fields doesn't impact functionality.

@Tides
Copy link
Member

Tides commented Jan 6, 2022

It's more or so a discussion for now and not something that should be touched 🙏 my point still stands and will not change regardless

@tacosontitan
Copy link

tacosontitan commented Jan 6, 2022

@Tides,

It's more or so a discussion for now and not something that should be touched 🙏 my point still stands and will not change regardless

No worries; I don't expect most developers to change their stance on a whim or the word of one or two others, it's usually something we have to get comfortable with on our own before we come to accept it, so I didn't mean any harm, just wanted to point out why the convention was introduced for the sake of others who might be reviewing the issue here.

Also, I didn't see any discussion threads on the topic; is that on the Discord server only at the moment?

@Tides
Copy link
Member

Tides commented Jan 6, 2022

@Tides,

It's more or so a discussion for now and not something that should be touched 🙏 my point still stands and will not change regardless

No worries; I don't expect most developers to change their stance on a whim or the word of one or two others, it's usually something we have to get comfortable with on our own before we come to accept it, so I didn't mean any harm, just wanted to point out why the convention was introduced for the sake of others who might be reviewing the issue here.

Also, I didn't see any discussion threads on the topic; is that on the Discord server only at the moment?

It's okay I understand ~ the issue was opened to highlight it's importance and get everyone's take so we can do something about it i believe. No one else has yet to reply to it so it's kinda a slow thing atm 🥲

@Naamloos Naamloos added the priority: medium Moderately important label Jan 9, 2022
@Seb-stian Seb-stian added priority: low Nice to have and removed priority: medium Moderately important labels Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-style Relates to code formatting and conventions priority: low Nice to have
Projects
None yet
Development

No branches or pull requests

4 participants