Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>Not in my POV. Esp. when working on code in use with many local (or even private) declaration my practice is to group the variables according to their datatype (and hungarian notation) into specific lines or line groups and initialize those lines or line groups with 1 statement each. That way often "forgotten" var inits are retrofitted.
>
>Of course old style functions with 50+ variables most of the time are better broken up into smaller functions each sporting only a handful of variables.
>
>>Its very bad advice to use STORE of many variables over the individual initialization of variables.
>>Individual initialization allows for better readability, especially when values might change over time.
>>
>>True it has some performance advantage, but it is so tiny that has no practical use except in the utmost extreme cases.
>>
Well said. If this change over time, change the code. Write it the first time so it's clear and fast and does not require more effort to step through in the debugger. I want to see the meat of the code, not a bunch of stupid crap assignment lines.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only