This post was inspired by [this forumthread][1] on [VBIB][2] (dutch).
Some people seem to forget that arrays in VB.Net are 0-based. Meaning that this.
Dim array1(0) As Integer
Console.WriteLine(array1.Count)```
This instantiates the array with one element in it. But there is nothing stopping you from creating an array with 0 elements in it. Appart from the fact that it seems a bit unnatural.
```vbnet
Dim array1(-1) As Integer
Console.WriteLine(array1.Count)```
And why would you do that? Why not just do.
```vbnet
Dim array1() As Integer
Console.WriteLine(array1.Count)```
Because the above will give you a NullReferenceException, that’s why.
So doing the unnatural is perhaps the way to go if you really need an array that has no predefined size.
[1]: http://www.vbib.be/index.php?/topic/10807-module-array-variabele/page__pid__59243#entry59243
[2]: http://www.vbib.be/