Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are nested functions a bad thing in gcc ? [closed]

Tags:

People also ask

Is it bad practice to use nested functions?

no, there's nothing wrong with that at all, and in js, it's usually a good thing. the inside functions may not be a pure function, if they rely on closure variables. If you don't need a closure or don't need to worry about polluting your namespace, write it as a sibling.

Why C does not have nested functions?

Nested function is not supported by C because we cannot define a function within another function in C. We can declare a function inside a function, but it's not a nested function.

Are nested functions Pythonic?

Inner functions, also known as nested functions, are functions that you define inside other functions. In Python, this kind of function has direct access to variables and names defined in the enclosing function.

Can you call a nested function outside a function?

Nested function is private to containing function Only the containing function can access the nested function. We cannot access it anywhere outside the function. This is because the inner function is defined in the scope of the outer function (or containing function).


I know that nested functions are not part of the standard C, but since they're present in gcc (and the fact that gcc is the only compiler i care about), i tend to use them quite often.

Is this a bad thing ? If so, could you show me some nasty examples ? What's the status of nested functions in gcc ? Are they going to be removed ?