3 ms·
Previous attempts to doing this have introduced unnecessary ugliness to the language such as the possibility to mix declarations with code. I can only see the l
by capsicum80 8y ago
Previous attempts to doing this have introduced unnecessary ugliness to the language such as the possibility to mix declarations with code. I can only see the language getting worse by introducing new pointless features. Unnecessary bloated C already exists and it is called C++
- Twisol 8y agoBy "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.
- capsicum80 8y agoThis, and especially in the first argument of 'for'. Not back compatible, very inelegant and luckily discouraged in many projects' coding guidelines.
- capsicum80 8y agoActually 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.
- Mikhail_Edoshin 8y ago(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.