Undocumented behavior in C #

Unlike C ++, C, etc. C # has very few undocumented actions, not the .NET Framework.

All programmers are aware of the dangers of comparing floating point numbers ...

When conducting a code review, it is often useful to have a checklist; one of the pairs in the checklist usually contains "undocumented behavior" in which the store will be seen and deleted.

What undocumented behavior should be in such a checklist for C #, and in which versions of C # there is a program.


This question was asked " How are ambiguous enumeration values โ€‹โ€‹allowed in C # ?", I was surprised by the answer, as in my many years, as a C # programmer, I do not remember to encounter any errors in C # code due to the use of behavior undefined, except for floating point numbers.

I recall from my distant past when I write code in C ++ that coding standards, etc. often had undefined behavior lists to avoid, but never seen such a list for C #.

+6
source share

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


All Articles