What the fuck is pic related? Are there people who actually start the name of things with an underscore? How the fuck do you get taught such an inefficient and useless convention instead of camelCasing?
Prefixing variables is basically what you do if you don't want anyone to use them, but still want them in the global scope.... Or if you're a php dev, may God have mercy on you.
Prefixing fields with an underscore is a standard u mong
Confirmed for never having worked with Python.
Underscore means protected variables because Python can't into true scoping / namespaces / whatever.
People use underscope as a workaround for this. I find it _hilarious.
>>51237289
It's the denote between a property and a regular variable or parameter that might have the same name.
If you're on a team, chances are you'll have a style guide.
>>51237565
that's not python and it didn't create the convention
>>51237601
You're right: I did.
I invented the underscore convention.
>>51237617
You are objectively a bad person
Underscores are a legitimate inefficiency to use because it requires you to hold down shift and press a key that is typically outside the standard range for your hands when using the keyboard. Just because python is a shit language and doesn't have things that should be common sense doesn't mean you can carry over this retarded concept to functionally good languages
>>51237781
Well, you can kiss my protected ass.
>>51237781
>standard range for your hands
get a better keyboard layout, pleb. underscores are common in function names, too. you seemed to ignore that.
>>51238174
Why the fuck don't you use camelCasing? Underscores should only be used for constants typed in all caps to signify a space between words
>>51237601
you're wrong, it is part of the python grammar
putting a underscore before the variable will invoke python name mangling, making the field much more difficult to access (typically used for private attributes)
>>51238593
how do you camelCase variable names like age. do you use "age" or "Age"?
>>51240221
just 'age'. The name of a class starts with a capital, but variables and methods start with a lower case letter. All subsequent words start with a capital, however the first word is always lowercase in a variable name
Literally who cares, it's just a convention.
If you're working on something personal, do whatever the fuck you want.
If you're working on a team use whatever you're told to use.
>>51237781
>Implying you use a QWERTY keyboard
>>51240221
C# style is to have properties (public member variables) PascalCase, In fact, many things use PascalCase. Also, camelCase or even _underscoreCamelCase are for private member variables.