Comment

Comment by henderson101

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

parent henderson101 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton