Signed vs. unsigned integers for lengths/counts
问题 For representing a length or count variable, is it better to use signed or unsigned integers? It seems to me that C++ STL tends to prefer unsigned ( std::size_t , like in std::vector::size(), instead C# BCL tends to prefer signed integers (like in ICollection.Count. Considering that a length or a count are non-negative integers, my intuition would choose unsigned ; but I fail to understand why the .NET designers chose signed integers. What is the best approach? What are the pros and cons of