Originally Posted by
anon
It's not the first time esbo has got us into a long and pointless discussion of the practices that he considers fine.
It's all just loads of non-sense.
For example, when he talks about the ease of tracking the global variable in every function with search tools, he doesn't take into account that it is not enough to see where a variable is used but also what has happened before and what is going to happen afterwards. When you want to understand what's going on you also need to track the program flow in the scope where the variable is alive, so that would be ... virtually in the entire code-base.
Compare that to tracking the program flow around the limited lifetime of a local variable. As to tracking the variable when passed to other functions under a "different name" then is it really the "same" variable in those other functions? Or do you really need to track down the whole execution flow to understand what's going on with one variable if you know what the function is supposed to do (but not all implementation details, of course)? Do you ever feel the need to "track down" the char pointer that you passed to strlen? What esbo fails to understand is that there might be advantages in making user-defined functions similar to standard library functions in this respect.