7 ms·
Maybe its just an old C (C90 I think?) habit where declarations and code could not be mixed.
by jaydub 17y ago
Maybe its just an old C (C90 I think?) habit where declarations and code could not be mixed.
- scorpioxy 17y agoYeah, I tend to do that too. And I did get it from when I was coding some form of C about 8 years ago. I think at the time I was using gcc 2.95 or something and it only allowed var declarations to be at the top. I sort of got used to it. Now I actually prefer it because when I am reading a new function, you get to see all the used variables and their comments right at the top. Also, declaring variables at the top helps with languages that don't have block scopes.