Hacker News new | past | comments | ask | show | jobs | submit login
All About Span: Exploring a New .NET Mainstay (microsoft.com)
19 points by yread on Dec 18, 2017 | hide | past | favorite | 3 comments



I think "mainstay" is a bit of a reach.

I love C# and I frequently have a need for high perf. However, unless you need that high perf, don't use Span<T>. Make your code more readable instead.


> However, unless you need that high perf, don't use Span<T>. Make your code more readable instead.

Is there anything in Span that inhibits readability?


Span<T> is safer than ArraySegement<T> as it only allows access to a window of array, rather than full array with a "request" to only look at offset->length

Span<T> is better than Array as it also comes with ReaOnlySpan<T> for a view with readonly array elements; whereas Array is always read/write.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: