© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Maxi Contieri
Software Engineer
TL;DR: Don't define too many unrelated constants in the same class. Don't pile up the junk together. Problems Bad Cohesion High Coupling Magic Numbers Single Responsibility principle violation Solutions Break the contents following Real World...
Interesting point of view. How do you feel about a class of classes, e.g.
public static class GlobalConstants { public static class MaxPlayers { public const int MaxPlayers = 10; } public static class DefaultLanguage { public const string DefaultLanguage = "en-US"; } public static class Math { public const double Pi = 3.14159; } }
Anthony Fung
Angular/.NET Web developer. I write insights, thoughts, and stories to help software developers build a solid foundation for their skills
IMHO, Nested classes are yet another code smell
Interesting point of view. How do you feel about a class of classes, e.g.
public static class GlobalConstants { public static class MaxPlayers { public const int MaxPlayers = 10; } public static class DefaultLanguage { public const string DefaultLanguage = "en-US"; } public static class Math { public const double Pi = 3.14159; } }