UnitsNet
ValueOf
UnitsNet | ValueOf | |
---|---|---|
8 | 9 | |
2,136 | 833 | |
- | - | |
8.5 | 0.0 | |
24 days ago | about 1 year ago | |
C# | C# | |
MIT No Attribution | 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.
UnitsNet
-
Java opensource projects that need help from community.
If engineering/scientific projects appeal to you, Units of measurement implementations for Java are woefully behind when compared with the likes of UnitsNet for C#.
-
Strong typedefs
Check out EngineeringUnits (https://github.com/MadsKirkFoged/EngineeringUnits), or UnitsNet (https://github.com/angularsen/UnitsNet)
-
General feedback on my first python script
https://github.com/angularsen/UnitsNet is sort of an extreme example of this, and their https://github.com/angularsen/UnitsNet/blob/master/Common/UnitDefinitions/Length.json gives an example of how to allow multiple names for units.
-
TypeDef for C#?
Just FYI: https://github.com/angularsen/UnitsNet
-
What is it about C# that you do NOT like compared to other languages?
(I occasionally use https://github.com/angularsen/UnitsNet/, but it's not quite the same as doing it at the compiler level.)
-
With all the new features and the upcoming features can I inherhit from int yet?
UnitsNet does this for common units of measure, and for a more general solution, there's also ValueOf
-
Preview Features in .NET 6 - Generic Math
Have you looked into using UnitsNet instead of rolling your own physical quantity library? I've used it before and it's pretty nice.
-
Recipes, conversions, and fractions; or how I wrote part of my C# app.
What would be best is if there was a library to use to convert things to and from measurements. This was what I first attempted, using The UnitsNet library. This library is excellent, and I recommend it to many people. The issue I have with it, is that it was far more in depth than what I need it to do.
ValueOf
-
Robust Design through Value Objects in C#
As we anticipate advancements in C#, we can still forge ahead with crafting resilient applications by utilizing the "ValueOf" package as a provisional solution. Below, we create a validated EmailAddress class leveraging the package:
-
Check out new C# 12 preview features! - .NET Blog
Probably better to use something like https://github.com/mcintyre321/ValueOf until we get a better solution (if we ever do). I agree that this is a pitfall.
-
Strong typedefs
The problem you’re describing here I think is ‘primitive obsession’, and the solution you’ve described is I think essentially a value object. This library might be useful https://github.com/mcintyre321/ValueOf
-
New Exception helpers in .NET 8
It lacks compile-time validation (though an analyzer that at least detects validation errors in the constructor should be fairly easy; more complicated flow control cases are probably hard), but at runtime, https://github.com/mcintyre321/ValueOf would let you do that.
- The power of OneOf. Unions for C#
-
Class vs Struct
If you want to wrap a small number of properties in a type to avoid primitive obsession, consider using ValueOf.
-
Is there anyway to override default values of the decimal type in c#?
You might be able to create a wrapper type with something like ValueOf.
-
Primitive Obsession
I good library I've found for addressing this issue is https://github.com/mcintyre321/ValueOf
What are some alternatives?
ShareX - ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
OneOf - Easy to use F#-like ~discriminated~ unions for C# with exhaustive compile time matching
unlib - a light-weight, header-only, dependency-free, C++14 library for ISO units
FSharp.UMX - F# units of measure for primitive non-numeric types
Papercut - Papercut SMTP -- The Simple Desktop Email Server
eShopOnWeb - Sample ASP.NET Core 8.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
CodeHub - CodeHub is an iOS application written using Xamarin
EngineeringUnits - Working with units made easy with automatic unit-check and converting between units
csharpier - CSharpier is an opinionated code formatter for c#.
coolstore-microservices - A full-stack .NET microservices build on Dapr and Tye
NodaTime - A better date and time API for .NET
StringlyTyped - A cure for StringlyTyped software and PrimitiveObsession