It’s neither good nor bad practice, it’s style.
Not to mention that good practice is usually a rule without explanation, so one takes it as a good thing without even knowing why and ends up becoming bad practice because it uses something potentially good in the wrong way and becomes bad. If people let go of this idea of good practice they would program better.
It can be used normally, the language accepted, so it’s not bad, if it were, it would prohibit.
The standard that was agreed to adopt in C# is not to use _
nor in the beginning, nor in the middle of the identifiers of all kinds. Some people violate it, but it gets weird for people who are used to codes in this language.
Today the underline has specific semantics in the language (value discard) using alone (no other characters), so it can make it a little difficult to read some codes, nothing serious, but creates some visual confusion.
This has nothing to do with the language being of high level, depends on culture created, that’s all.
Just remembering that JS doesn’t adopt this style either (Google, Douglas Crockford), some people adopt. In PHP it is inconsistent. So I probably wasn’t following that "good practice".
If you do so in C# your code will look alien to other people.
Thank you for the opinion, it would really seem alien, I agree with you. In all the companies I worked there is the fight "whether use or not use underline", it is similar to the fight "key in the same line or key below" (I am the key team below hehehe)
– Mateus Mattielo Nickhorn
It’s not an opinion, it’s a fact, we don’t give opinions here.
– Maniero
Okay, thanks for the suit
– Mateus Mattielo Nickhorn
@Maniero, but JS uses underline yes.
– Mirian cherbo
@Miriancherbo I quoted two references you can quote from.
– Maniero
@Maniero, you said yes, but they’re not official language links or her breeding grounds. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Values,_variables,_and_literals#Vari%C3%A1veis
– Mirian cherbo
@Miriancherbo But they are guides who people follow. What you mentioned is not a guide, and even if it were, it would not be official because there is no official. Being able to use doesn’t mean you should use.
– Maniero