1

There are many places in the .NET framework where int seems to be used instead of uint where one would never expect a negative number.

For example .Take() in LINQ takes an integer. Port in IPEndpoint or other network classes is a signed integer. And so on.

Is there a reason for this 'loose' typing?

Sentinel
  • 3,582
  • 1
  • 30
  • 44
  • 1
    related : [Using uint vs int](https://stackoverflow.com/questions/3095805/using-uint-vs-int) – Pac0 Apr 26 '18 at 12:12
  • also related on software engineering : https://softwareengineering.stackexchange.com/questions/306677/should-i-avoid-using-unsigned-int-in-c – Pac0 Apr 26 '18 at 12:15

0 Answers0