2 ms·
While it might be annoying to use local variables, I usually find it's superior when debugging. It allows you to easily inspect the value and modify it before g
by magicalhippo 7y ago
While it might be annoying to use local variables, I usually find it's superior when debugging. It allows you to easily inspect the value and modify it before going forwards.
It also usually helps to make the code more self-documenting
- zenhack 7y agoIt's definitely easier to deal with when using a debugger. But that brings a question to my mind: Why are there so many debuggers that make inspecting the results of intermediate expressions difficult? I should be able to step through my code at a finer granularity than a statement. Re: self-documenting, certainly sometimes (I mean, you shouldn't play code golf...), but in this case the code in question was: 2218 if (!valid_localpart(maddr->user) || 2219 !valid_domainpart(maddr->domain)) { .... 2234 return (0); 2235 } 2236 2237 return (1); It's not obvious to me what you would name the intermediate booleans that would be more self-documenting than the function names used there.