I know that pre C99 compilers needed variables to be declared at the beginning of a function to calculate stack size. Then the requirement was lifted. Nowadays, besides backwards compability, is there any benefit from still sticking to that scheme, or maybe is declaring variables only when they are needed and where they are needed better? (for instance in an if statement, where one branch requires a variable but second one doesn't)