NamedType
Implementation of strong types in C++ (by joboccara)
da-unit
Typescript unit conversions (by mannershark)
NamedType | da-unit | |
---|---|---|
6 | 1 | |
742 | 1 | |
- | - | |
0.0 | 0.0 | |
over 1 year ago | almost 3 years ago | |
C++ | TypeScript | |
MIT License | - |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.
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.
NamedType
Posts with mentions or reviews of NamedType.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-03-21.
- Named Types in C++
-
Named Booleans prevent C++ bugs and save you time
This article seems to be targeted towards beginners. From the title, I was expecting it to cover something like https://github.com/joboccara/NamedType, which is a technique I would recommend.
-
Please put units in names
I haven't used this library in particular or this one, but bless the authors and all the others for trying to make it happen… the project I'm now leading uses strongly typed strings for different component addresses, and it saves me to constantly look up the documentation what the functions need – it's beautiful.
-
Why do you like C++ ?
I think you are thinking of something like https://github.com/joboccara/namedtype
-
ISR Context Guards in C and C++ — Creating better interfaces for Embedded Systems by selecting the correct functions at compile time
The basic jist is that if you use strong types, you can dispatch more easily inside the function. Because of how the template function is generically written, I don't need to do any manual calls to the template parameters, it all gets figured out through automatic template deduction. In this example I'm using really simple types, but in a more production system I would use something more along the lines of Jonathan Boccara's NamedType. Here is a great article that explains it pretty well [link].
- Alternative to long boolean parameter lists
da-unit
Posts with mentions or reviews of da-unit.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-03-21.
-
Please put units in names
For this purpose I'm pretty ok with Hungarian notation. Haven't found a nice type based solution yet. I tried to roll my own, but looking back I'm not really satisfied with it. Besides, I'm no longer doing anything with physics calculations.
What are some alternatives?
When comparing NamedType and da-unit you can also consider the following projects:
newtype-ts - Implementation of newtypes in TypeScript
Squants - The Scala API for Quantities, Units of Measure and Dimensional Analysis
durationcheck - Go linter to detect erroneous multiplication of duration values