2 ms·
In a 50 line function with 5 variables, I find it much easier to look at 5 lines of variable declarations to figure out how I declared a variable than to scan t
by cperciva 16y ago
In a 50 line function with 5 variables, I find it much easier to look at 5 lines of variable declarations to figure out how I declared a variable than to scan through up to 50 lines of code.
- loup-vaillant 16y agoSo, declaring variables at the top of the function makes it easy to find them. Now how do you find the point of initialization? declare x | ... | ... initialize x | declare & initialize x ... | ... use x | use x In both cases, you will have to scan for the whole function, or hit the "search" hotkey. Or maybe sometimes you just need to know when `x` were declared, but not what value it holds?
- Qz 16y agoStop writing 50 line functions.