请告诉我,使用符号数为指标的净道理呢?
Whats the rationale for using signed numbers as indexes in .Net?
在Python中,你可以从指数的阵列发送负数的结束,但这不是在.NET中的情况。 这是不容易的净增加这样的功能之后,它可以打破可能使用特殊规则等code(是的,一个坏主意,但我想它发生)的索引。
In Python, you can index from the end of an array by sending negative numbers, but this is not the case in .Net. It's not easy for .Net to add such a feature later as it could break other code perhaps using special rules (yeah, a bad idea, but I guess it happens) on indexing.
不,我曾经也需要数组索引的面积都超过2,147,483,647,但我真的不明白,为什么他们选择有符号数。
Not that I have ever have needed to index arrays over 2,147,483,647 in size, but I really cannot understand why they choose signed numbers.
这可能是因为这是比较正常的使用有符号数在code?
Can it be because it's more normal to use signed numbers in code?
编辑:我刚刚发现这些链接:
I just found these links:
无符号的迭代的危险在C / C ++
符号字长度和索引
EDIT2:好的,一对夫妇从线程马修•富兰琛贴其他原因:
Ok, a couple of other good reasons from the thread Matthew Flaschen posted:
在历史的原因,因为它是一个类似C语言 在互操作使用C有关课程的简单性。你喜欢麻烦做算术大小无符号整型?
For simplicity of course. Do you like trouble doing size arithmetic with unsigned ints?
上一篇:Android的 - OnScrollListener的交错网格视图网格、视图、Android、OnScrollListener
下一篇:通过OpenSSL的我的Android应用自签名证书在Windows中创建PKCS#12文件我的、证书、文件、Andr