Coding Styles when Dim'ing an object

From a newsgroup post: What's the difference between these three declarations:

Dim objData1 As New DataSet()

Dim objdata1 As DataSet = New DataSet()

Dim objdata1 As DataSet
objdata1 = New DataSet()

I knew they were all the same, but I compiled them all and checked out the IL for each one. The verdict? The exact same IL is emitted for all three declarations.

No Comments