• tom_ (unregistered)

    confusion is the key!

  • Paul Hill (unregistered)

    I love the way they eat any exception, rather than what .FindByValue returns. Mmmm.... silently failing code....

  • Factory (unregistered)

    To get the most out of this blog it seems working knowledge of VB and SQL are really needed.
    I have also realized that I never want to use VB or SQL, ever.

  • Tony (unregistered)

    Since this guy broke the mold I figure I can finally implement this code:

    Public Function IsIntBob(value as Integer) as Boolean
    If ctype(ctype(value, Double), String) = "Bob" Then
    Return True
    Else
    Return False
    End if
    End Function

  • Alex Papadimoulis (unregistered)

    Tony, that is hysterical.

  • (Anonymous) (unregistered)

    But Tony, shouldn't you surround that with a Try…Catch, just in case there's an InvalidCastException?

  • Aiax (unregistered)

    If you would like to see more examples, just let me know. I've spent months replacing code like this from this particular colleague and since I use source control, I can always go back into history and find some code for a good laugh now and then.

  • Eric Newton (unregistered)

    Hey, I wonder if a few lines down, we see:

    Public Readonly Property GetDocumentIndex() as Int32
    Get
    return ddlDocument.SelectedIndex
    End Get
    End Property

  • anon (unregistered)

    Oh thats nothing. How about this?

    Public ReadOnly Property GetProduction(ByVal vType As eProductionType) As String
    Get
    Dim oDataView As DataView
    Select Case vType
    Case eProductionType.Projected
    Return FormatOrderAmount(SelectedGroup.ProjectedProduction)
    Case eProductionType.OnHold
    Return FormatOrderAmount(SelectedGroup.OnHoldOrderTotal)
    Case eProductionType.Potential
    Return FormatOrderAmount(SelectedGroup.PotentialProduction)
    End Select
    End Get
    End Property

    A parameterized read only property named with a Get prefix! I'm at a loss for words.

  • anon (unregistered)

    I like to call the above pattern an "Propenumtion". It use an enum and a paramterized property that to all others looks like a function.

Leave a comment on “objDocument.SetDocumentIndex = "WTF"”

Log In or post as a guest

Replying to comment #:

« Return to Article