4 ms·
Newtypes are also pretty great for detecting logic errors. (You can use them in Go and C# but they're not idiomatic and usually not zero-cost so people usually
by roca 6y ago
Newtypes are also pretty great for detecting logic errors. (You can use them in Go and C# but they're not idiomatic and usually not zero-cost so people usually don't.)
- throwaway894345 6y agoNewtypes are pretty idiomatic in Go (e.g., https://golang.org/src/os/types.go#L35 https://golang.org/src/os/types.go#L35), and they're so inexpensive that cost isn't a reason to forego them 99% of the time.
- roca 6y agoSorry, my mistake, thanks for the correction.
- pjmlp 6y agoBesides the sibling answer about Go, when you are in .NET world there are also F# and C++/CLI to chose from, so C# doesn't stand alone (leaving VB.NET out as it appeals other kind of developers).