3 ms·
R# should warn "unused variable myvar" on the first one. You'll get a compiler error if you try and use `I` uninitialized. Not saying you're wrong, just havin
by taspeotis 10y ago
R# should warn "unused variable myvar" on the first one.
You'll get a compiler error if you try and use `I` uninitialized.
Not saying you're wrong, just having trouble getting worried about this. You can make typos now:
int x, y;
foo(out x, out x); // oops, not y; was up too late coding
- dleslie 10y agoIn a non-trivial example it's likely that `myvar` or `I` would see themselves used elsewhere, perhaps even as an out value to another method, and so raise no warnings. The source of the problem won't be so obvious at-a-glance because the new declaration syntax aren't so different from existing syntax, and could easily go unnoticed when shadowing existing values deep within a function. Sure, you can make typos now, but these changes expand the possibilities of errors arising from typos or incomplete refactoring; while reducing the discoverability of the issue at-a-glance.