103

It would be great to make #region (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-region) also available in X++.


It will make the code more readable, understandable and maintainable.


 

Category: Development
STATUS DETAILS
Under Review
Ideas Administrator

I agree on the usefulness of this feature. It is currently not planned because of other priorities, I will keep this idea active and under review.

Comments

M

Code regions are like any other coding aspect to be used and the people decide wether they use it in a correct or in a wrong way. I would rather like to have the ability to have this feature in X++ and use it in a proper way than saying this is something that will have no added value for us.
Let's get it in there and enable people decorating their code with some generic guide lines. Thanks!

Category: Development

M

I'll just leave this here... https://blog.codinghorror.com/the-problem-with-code-folding/

Category: Development

M

Mark Nelson, with all the respect, I think you are confused. Regions are useful for organizing code. It's not about documenting the code and it's not about hiding code. Organizing the code and documented it with comments are two different things.

Category: Development

M

To a certain extent, I agree with Mark's comment. Regions often have a negative effect on readability. However, when used correctly and in moderation, it does have its advantages. But, when the tool does not exist, there is no advantage at all.

Category: Development

M

This is one of single worst readability features in C#.  Use regular comments to document your code.  If you find yourself hiding code with regions you should reevaluate whether that code should even exist.

Category: Development