in reply to on to better coding (no uninitialized values)
If you're getting these frequently, then you have enough data to look for patterns. Without knowing what the underlying problem patterns are, you run the risk of hiding problems deeper by, for example, always manually initializing variables.
Getting an "uninitialized value" warning tells you that you managed to get to a specific place in your code without having a value assigned to a variable (or element of an array or hash) at a value is now needed. (That's the "well, duh" part.) What's more interesting is why?
I had a problem early in my career with a certain pattern of conditional logic. I'd try to write code in a certain way, and my brain would basically hit a blind spot. Debugging was a bitch, because my brain wasn't untangling what it was seeing. Only by stopping to analyze the problem (with some help) was I able to make it go away.
|
|---|