C#

C#

Made by DeepSource

Consider using the default literal over default(T) CS-R1097

Anti-pattern
Major
Autofix

The default(T) expression returns whatever the default value is for the type T depending on whether it is a value type or a reference type. Using the default literal accomplishes the exact same thing and is easier to read.

Bad Practice

public T t = default(T);

Recommended

public T t = default;