C#

C#

Made by DeepSource

Avoid multiple assignments in a single expression CS-R1143

Anti-pattern
Major

While assignments are simple to read and comprehend, it is easy to negatively affect the readability by adding more assignments to the same expression. While it may save you a few lines of code, it may introduce bugs into your application and additionally cause confusion to the readers. Instead, consider breaking down the complex assignment and placing each assignment separately.

Bad Practice

c = b = a;

Recommended

b = a;
c = b;