Hacker News new | ask | show | jobs
by henderson101 4109 days ago
No, no, no! I work in both on a daily basis, and have done since 2006/2007. Around 2006 I started migrating Delphi code to .Net for an employer (they had a lot of VB.Net already through acquisitions). Then circa 2007, I started at a company that used a VB.Net 1.1 codebase, upgraded it through to 4.0 adding in a lot of C# assemblies and extensions along the way - culminating with a complete refactor of all key components in to C#.) Now I work with a codebase that is mainly VB.Net but all new code is in C#.

VB.Net is a horrible language that lets developers get away with some really awful practices. The fact that the various Options are still present, and not on by default, is a recipe for disaster. That this is legal:

Sub Main dim x as boolean = false ''or true... dim y as integer = 0

select case y case x Console.Write("What does this even equate to???") end select End Sub

end case

or that this is legal:

    Class SomeArgs
        Inherits EventArgs
		
		public Property Message as String
    End Class

    Class HorribleCode
        Public Event Blah(ByVal sender As Object, ByVal e As Someargs)

        Public Sub Doit()
            RaiseEvent Blah(Me, new SomeArgs with { .Message = "Wow... YUCK!!!!"})
        End Sub
    End Class

    Public WithEvents ThisSucks As HorribleCode

    Public Sub ThisReallyWorks(ByVal sender As Object, ByVal e As Someargs) Handles ThisSucks.Blah
        System.Console.WriteLine(e.Message)
    End Sub


    Sub Main()
        Dim h As New HorribleCode

        ThisSucks = h

        ThisSucks.Doit()

    End Sub
Yes, I dealt with code that had both of those "techniques" in it... ugh.

The second example was mainly because the off shore coders didn't realise AddHandler/RemoveHandler existed... le sigh

1 comments

Not sure I follow your point. You can write really bad C#. And you can write even worse c++. The quality of a language isn't about how bad you can twist it if you decide to be reckless.

In fact I must say one of the things that I appreciate the most about VB, beside case insensitivity is the IDE. I think c# is catching up now but the VB IDE is incredible in term of how much help you get, immediate feedback on what went wrong, rich auto-completion of code.

The code completion is just as good or better for c# from my experience