4 ms·
Never seen single underscore as variable, field or method name and never seen any naming convention that allowed that (and I've read a lot of open source code t
by ivan_gammel 10y ago
Never seen single underscore as variable, field or method name and never seen any naming convention that allowed that (and I've read a lot of open source code too). Conclusion: it's a pain only for those who didn't care about readability of their code and it's definitely not the end of the world.
- sharpercoder 10y agoI've seen it popping up a lot lately. It's used as an identifier for lambda functions, indicating "i must use a variable identifier here, but I don't use it" someObject.doSomething(_ -> isDerp());
- ivan_gammel 10y agoExactly the case when you get warning in Java 8. Bad code written by lazy devs and now it's time for them to pay.
- thechewanater 10y agoNo it's not, it's illegal to use _ as a lambda parameter.