Hacker News new | ask | show | jobs
by Twisol 2776 days ago
By "mix declarations with code", do you mean the ability to put local variables like `int x;` in locations other than immediately at the start of a function? I don't understand why this is a bad thing.
2 comments

(In C you can have local variables inside any block, e.g. 'if' or 'for'.) It's subjective, of course, but I find it much clearer to have a dedicated place to look for variables.
This, and especially in the first argument of 'for'. Not back compatible, very inelegant and luckily discouraged in many projects' coding guidelines.
Actually it is block, not function. It makes it very difficult to read the code if you are looking for the scope of the variables, or investigating stack usage.