HeuristicsForCleanCode
SmartEnum
HeuristicsForCleanCode | SmartEnum | |
---|---|---|
3 | 7 | |
18 | 2,064 | |
- | - | |
4.5 | 8.1 | |
3 months ago | 3 days ago | |
C# | C# | |
The Unlicense | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
HeuristicsForCleanCode
-
Do you write clean code? Check it out
Greetings everyone on Hacker News! Today, I want to share with you my GitHub repository, which contains heuristics rules from Robert Martin's "Clean Code" book. The idea of creating this repository came to me while reading the book when I realized that I would like to have all these rules at my fingertips in a convenient format.
If you work in programming, you are probably familiar with this book. It is a valuable source of information and advice on how to write understandable and clean code. In my repository, I have collected these rules in a wiki format in three languages - English, Russian, and Ukrainian, so that everyone can easily familiarize themselves with them and apply them in their work.
In addition, most of the rules are supported by code examples in C# and Java. These examples are named and numbered according to the corresponding rules they demonstrate. The code also contains comments that further illustrate the rules.
Moreover, it is very convenient to copy links to specific rules and share them with everyone. For example, if you want to share a link to the "Use Explanatory Variables" rule, you can copy the link and send it to your colleague.
I hope that my repository will be useful for everyone who wants to improve their programming skills and write cleaner and more understandable code. "Heuristics for Clean Code" will evolve and be supplemented with examples in other programming languages. I look forward to your feedback and suggestions and hope that you will find my repository useful.
Link to the repository: https://github.com/SaintZet/HeuristicsForCleanCode
Wishing you successful coding and don't forget that code is art!
SmartEnum
- Java or C# for backed
-
Is there a "right" way to consolidate constants in C#/.NET?
I agree SmartEnum is my go-to for this
-
best practice to create a method with params of limited values
If we knew more about these methods and what kinds of parameters they take we could maybe make some suggestions. There are some patterns like smart enum that are sometimes just the thing.
-
Smart Enums In C# Like Java
In C# I am not able to add constructors, properties, and methods. although there is a library to do this https://github.com/Ardalis/SmartEnum but wouldn't be nice if we have this feature built-in to C#.
- What is it about C# that you do NOT like compared to other languages?
-
Displaying Enums with custom value
You can use the SmartEnum library.
- C# records can be used to emulate Java's fancy enums.
What are some alternatives?
sardine-can - Humble 3D knapsack / bin packing solver
Enums.NET - Enums.NET is a high-performance type-safe .NET enum utility library
SmartAnnotations - A library for .NET that uses source generators to automatically generate data annotations for your models.
csharplang - The official repo for the design of the C# programming language
Result - A result abstraction that can be mapped to HTTP response codes if needed.
NodaTime - A better date and time API for .NET
UnitsNet - Makes life working with units of measurement just a little bit better.
.NET Runtime - .NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
software-design-patterns - C# Design Patterns Tutorial Sample Code
csharp-dotnet-digest-authentication - A basic example of digest authentication using C# and .NET
Crow - C# Rapid Open Widgets