On 8/20/21 12:30 PM, Ranier Vilela wrote: > > > There is a reason why GMs Brian Kernighan and Dennis Ritchie made the > C89, less buggy. > IMHO C99 makes it easy to make more mistakes. > One more step and we won't even need to declare a variable. > >
I've used both styles in different languages over the years. I don't know that one is a clearly better way, notwithstanding what various theorists might say. Note that in C89 it's fantastically easy to put the declaration as close as you like to the first use of a variable. All it takes is a pair of braces enclosing the variable scope. Even if we were to relax our rules on this, making wholesale changes along these lines and even more backpatching them seem out of the question. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com