Can comments or brackets erase C # code?

I saw comments that violate Java code, and I remember that the brace style can go bad with C ++ code. Are there any cases where comments or a binding style (or a coding style in general) can affect the correctness or source code? I can’t think of anything from my head.

(I do not explicitly ask how to comment and which brace style to choose, unless this is a direct result of trying to keep the code correct.)

+3
source share
3 answers

As you understand the problem of "unicode escape sequences in comments" (in the comments to the question) - C # is not vulnerable to this. Escape sequences, such as \u000d, are converted only to the corresponding Unicode characters in string and character literals and in identifiers.

Regarding the binding aspect: I assume that this applies to macros in C ++, although again an example would be convenient. Not a problem in C #, which has no macros.

There are some subtle issues with other style options, for example, whether your directives appear using inside or outside the namespace declaration . But nothing in terms of comments and braces, as far as I know.

+4
source

No, this is impossible, and more importantly: it should not be.

+3

Microsoft # parser: no. .

0

Source: https://habr.com/ru/post/1792001/


All Articles