Array Basics Example

Oh arrays arrays. How some of us love to hate these. The question always comes up, heck even I ask it. Why use arrays now when there are so many other collection classes in the .NET framework. Especially when the other options are easier to work with and more functionality? You will see me from time to time reverting back to arrays because they teach me the basics of how the other collection options function under the hood. I mean look under the hood at the List collection class. If you look at the methods in that class and how they work. It’s basically doing array work behind the scenes.

One of the most confusing areas of programming, well it was for me when I started. Was the difference between value, reference types, stack, and heap allocation. Arrays helped me understand how reference types work. Meaning that when you make a change to an array anything else that references said array will change also.

So over the next batch of posts you will see various usages of arrays. The programs will be simple. I will still make the source code available if you want.

Continue reading

Advertisements