2 ms·
> I checked and indeed... lg_buf is a global variable. struct lg_buf is a type, not any kind of variable. And here _ is a local variable, not a global variable
by chrisseaton 6y ago
> I checked and indeed... lg_buf is a global variable.
struct lg_buf is a type, not any kind of variable. And here _ is a local variable, not a global variable so can't conflict with anything else anyway.
So what you've said doesn't apply for more than one reason.
- Randor 6y agoThanks, In that case I don't really know why the guy named his variable with an underscore.
- codr7 6y agoBecause it's short, easy to recognize and somewhat accepted to signify that the name doesn't matter and even 'it' in Perl. I find that using it for the default parameter (or self) simplifies the code substantially on a visual level.