News for hackers. Stuff that matters.
Re:Arrays considered somewhat harmful by Aaronontheweb on Monday January 24, 2011 @03:40PM (#2136661)
For .NET devs: Always use something that implements IList instead of a primitive array. As Eric points out, you can make it read-only and avoid the malloc frenzy that occurs under the hood when you work with methods that return primitive arrays.

You can also inherit from any of the IList / IEnumerable / ICollection types and make customizations to better support parallelism, memory usage, etc... I've done implementations on top of IQueue (a cousin of IList) before to support custom Reader/Writer scenarios for a parallelized polling service (in-memory job queue) and it worked well.

There are no comments on this comment yet.