visual studio - Why is #region a directive and not a comment? -


i assume #region ignored , dropped compiler, why preprocessor directive rather kind of comment structure (like //region name: stuff(); //endregion name or something.) there particular reason decision make directive made?

i know it's not direct answer that's how it's laid out in c# language spec (§2.5).

the pre-processing directives provide ability conditionally skip sections of source files, report error , warning conditions, , delineate distinct regions of source code.

i don't think it's ignored compiler, doesn't have effect. it's still considered conditional compilation lexical processing point of view and, therefore, in line of other pre-processing directives. spec:

the lexical processing of region:

#region

...

#endregion

corresponds lexical processing of conditional compilation directive of form:

#if true

...

#endif


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -