Removing uninitialized_var()
Posted Dec 21, 2012 2:22 UTC (Fri) by
giraffedata (subscriber, #1954)
Parent article:
Removing uninitialized_var()
The reason I don't initialize a variable to avoid the false positive warning is that it makes the code harder to read. It suggests that the variable's value is meaningful in places where it isn't. That requires more time and short term memory for the reader to understand the code.
I just disable the warning (by compiler option). I do appreciate it finding my used-before-set variables, but it isn't worth the false positives or dirtying of the code.
(
Log in to post comments)