Bad code snippet:
public static class ReactionTypes {
This APIView comment is misrepresenting the code by claiming that known value sets must use an enum (or readonly struct if extensible). The architect noted that this guidance is out-of-date, and that using string literals/static value-holder classes is valid in many .NET types.
Good code snippet:
public static class ReactionTypes
{
public const string Like = "like";
public const string Love = "love";
}
Bad code snippet:
This APIView comment is misrepresenting the code by claiming that known value sets must use an enum (or readonly struct if extensible). The architect noted that this guidance is out-of-date, and that using string literals/static value-holder classes is valid in many .NET types.
Good code snippet: