Floating curly braces in C#

You can use an open and close set of curly braces to define a self containing block, which has its own scope.

This is generally not considered good programming practice, though.

Usually if someone is doing something like this, it’s probably better to create a method/function in its place.

Leave a Comment