CuriOddities, part 3 [Kit George]
Time for another interesting snippet, in which the code itself doesn't appear bad at first glance, but again: the coder seems to be making an assumption about the way they have constructed the code, which is incorrect. And in fact, it's not an appropriate design. And yes, this gets the fxcop nod, but spot the problem before trying that out.
Public Class UnexpectedBehaviors Public Shared ReadOnly ValidSeasons As String() = {"Spring", _
"Summer", "Autumn", "Winter"}
Public Shared Sub PrintSeasons()
For Each season As String In ValidSeasons
Console.WriteLine(season)
Next
End Sub
End
Class
The question with this one is: what's the assumption, and what's bad about it?