Don't be a Hero


  • BINNED

    Note to self: when you see this line of code at the top of an SSIS script task, just hit the close button and pretend you didn't see anything:

    [code]Option Strict Off[/code]

  • Trolleybus Mechanic

    Most likely the original devs didn't know how to type check items submitted via Form or QueryString. If you kept reading, you'd probably see this:

    intUserID = Request("user_id")

    if (intUserID > 0) then

       strSQL = "SELECT * FROM tbl_user WHERE user_id=" + user_id + ";"

    end if

    If you're lucky, that's all you'll have seen. There's still a non-zero chance something would have made your eyes melt out through your testicles.  (Which would have melted too)

     



  • BINNED

    Actually, it wasn't an ASP, it was part of an SSIS package, which uses VB.NET. The next thing after the Option Strict Off was a few global untyped variables, followed by CreateObject("Scripting.FileSystemObject"). So it was the System.IO namespace the original developer didn't know about. Also, things like Array.IndexOf. It could be worse, though: at my last job a co-worker didn't now about the Split function (in VB6) so she wrote her own.



  • @PedanticCurmudgeon said:

    a co-worker didn't now about the Split function (in VB6) so she wrote her own.
     

    I can sort of forgive and/or forget that sort of thing when I point it out and the person's all OH FUCK YES THX BRO.



  • @PedanticCurmudgeon said:

    a co-worker didn't now about the Split function (in VB6) so she wrote her own.

    I do recall that at one point in time, only one of VB6 and Office VBA had a Split function; so depending on the age of the code (or the co-worker?), that's not entirely unreasonable. I recall having to write a Split function myself because I needed to use it in VB (or VBA, whatever!).


  • BINNED

    Call me old-fashioned, but I think that one problem with popular programming languages these days is that people can be productive without reading the documentation. Then, because they're productive, they never bother to read the documentation and never find out about functions that could be useful.

    EDIT: You guys are probably right about the Split function, though.



  • @PedanticCurmudgeon said:

    Call me old-fashioned, but I think that one problem with popular programming languages these days is that people can be productive without reading the documentation.
     

    The old guys said that about you when you started out programming in these handy new languages, so I don't think this is a valid criticism. It's down to the person, not the tool.



  • @Cad Delworth said:

    @PedanticCurmudgeon said:
    a co-worker didn't now about the Split function (in VB6) so she wrote her own.
    I do recall that at one point in time, only one of VB6 and Office VBA had a Split function; so depending on the age of the code (or the co-worker?), that's not entirely unreasonable. I recall having to write a Split function myself because I needed to use it in VB (or VBA, whatever!).
     

     

    It was new to VB6.


Log in to reply