Tuesday, November 24, 2009

Dim x as New

Let me say in my not so humble opinion that 'AS NEW' is dead in my eyes. I always hated back in my VB6 days that some variables had to be declared "AS NEW" while others had to just "AS". As soon as I discovered in .NET that you never have to use "AS NEW" but instead you can use "Dim X AS MyObj = New MyObj" I was sold.

Sometimes when I am lazy I still use "AS NEW" but I think it's a bad habit, and should never appear in 'good' code.

No comments:

Post a Comment