Skip to content
Discussion options

You must be logged in to vote

Is it reasonable to replace those with unsigned counterparts?

It is still beneficial to utilize signed types in normal managed APIs. This is primarily because everything else in the ecosystem takes signed types and it avoids the messiness of needing to cast or handle overflow.

I'm loosing 1 bit of information (I can store [0..(2^31-1)] range instead of [0..2^32-1])

Many scenarios don't actually need this extra bit and you may end up "losing" it anyways when interacting with most other existing APIs, like say Span<T>, where it only takes a signed type anyways.

As of today, CLSCompliant attribute and the requirements behind it mostly are the part of history

CLSCompliant is missing a l…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sakno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants