For those of you still complaining about the introduction of Generics in
Java, know that
Visual Basic will have Generics as well in Whidbey (the next version of
Visual Studio):
Class MyCollection(Of ElementType) Sub Add(Byval key As String, Byval Element As ElementType) 'Note that the type parameter ElementType is being used inside 'the generic type just like any other type ' Dim Element2 As ElementType ... End Sub ... End Class Dim IntegerCol As New MyCollection(Of Integer) Dim DateCol As New MyCollection(Of Date)
Needless to say this beast bears very little resemblance with the Basic of my
childhood (Applesoft Basic).
#1 by Merrick on July 9, 2004 - 7:59 am
Your example is the normal form we get today. The generic version is slightly more obfuscated: Sub Sort(Of T)(Byval Arr() As T) … End Sub.
#2 by Robert Watkins on July 13, 2004 - 4:47 am
This isn’t really surprising; VB.NET is really just a syntatic translation of C#. Makes you wonder why they bothered…