The variable/function name starts with underscore "_" means that it is a private variable/function in Dart language. It is well-known.
What if the underscore variable is used inside a function?
Is it necessary to use declare an underscored variable in a function(not in a class) to denote that the variable is only used in the function? or as it is self-evident that the declared variable can only be used in the function so that using underscore prefix is just a redundant thing? (or for the naming convention?) (when the function does not have any inner-function)
With underscore:
void sample() {
var _something = getSomething();
doSomethingWith(_something);
//use _something
}
Without underscore:
void sample() {
var something = getSomething();
doSomethingWith(something);
//use something
}
Plus, is there any performance-related difference between them?