• Kris (unregistered)


  • piet (unregistered)

    frecond? please, can we stop being frist? growing accustomed to such code so you know it by heart is even worse...

  • bvs23bkv33 (unregistered)

    can I use that piece of code to sort comments descending? first will not be first anymore

  • (nodebb) in reply to bvs23bkv33

    Well, they are already sorted descending by age...

  • Derp (unregistered)

    It's almost like VB developers are, without fail, complete and utter morons.

  • Greybeard (unregistered)

    Derp: I'd be more understanding of VB developers from the past. Back in the early days of desktop computers many, many "developers" were self taught: WTF-ery came from a lack of education not their innate ability.

  • EvilSnack (unregistered)

    VB is founded on the assumption that software development is a skill which can be brought to the masses. The entire VB code base stands as testament to the falsehood of this assumption.

  • Appalled (unregistered)

    Most VB Developers came from VBA Developers, i.e MS Access 97 (and earlier) applications (Excel as well but that's another story). There's your problem right there. They weren't programmers but after farting around in Access Forms and Modules they could say they were and get a VB job or "become" a VB programmer when Management decided VB should be used "for all future development"..

  • Tim (unregistered)

    Also let's not forget the language features in VB6 (and sample code you'll find on the internet) are forever trying to steer you down the path of bad quality, so producing a good VB6 program requires a much higher level of discipline in the novice than say Java or C#

  • SyntaxError (unregistered)

    The world is often unkind to new talent, new creations. The new needs friends. Last night, I experienced something new: an extraordinary meal from a singularly unexpected source. To say that both the meal and its maker have challenged my preconceptions about fine cooking is a gross understatement. They have rocked me to my core. In the past, I have made no secret of my disdain for Chef Gusteau's famous motto, "Anyone can cook." But I realize, only now do I truly understand what he meant. Not everyone can become a great artist; but a great artist can come from anywhere.

  • Foo AKA Fooo (unregistered) in reply to bvs23bkv33

    Sure: Comments.sort (1) to keep only the last comment, i.e. mine. Therefore:


  • Steve (unregistered)

    For I = 1 to m_Col.Count Step modulo

    won't work (unless modulo = 1). The correct replacement should be:

    For I = modulo to m_Col.Count Step modulo

  • ccjjharmon (unregistered)

    Ah.... if only I had a copy of some truly nightmarish VBA macros to show off here embedded in multiple Excel workbooks that somehow "worked together" to form what was actually used as a business process for cash management. The variables if I recall were all only a single character in length and reused and redimensioned multiple times, pulled data out of different worksheets (of course), created new workbook files with results, had to be run only within a window of an hour daily. The best part was that the team using it needed it to be documented because surprise they didn't know how it really worked... and I had to debug it with the max time every day of an hour to step through the code. I don't recall how many lines of code it was in totality, but I do remember it took months to fully "document" the process.

    Scariest part of all is that the "developer" who wrote it had previously written many more VBA macros in the same organization AND after leaving, he went to another organization and apparently became "famous" writing more of that junk/madness there as well. I wish I could say this was a long time ago, but I believe it was only around 2014 or so...

  • (nodebb)

    and I had to debug it with the max time every day of an hour to step through the code.

    Couldn't you just change your clock? You didn't say anything about external access.

    BTW I've had my share of VBA macros, that I wrote myself in a past life as a manager of a pizza place. My code managed to interface with a comms program that used a modem to dialup the store computer to run a report, download into Excel, do some more processing and migrate into business-required format.

  • gggg (unregistered)

    Good grief. The FOR command has had a STEP option since at least 1968.

  • löchlein deluxe (unregistered)

    I thought "TRWTF is the submitter" was something restricted to the comments section?

    (Dear G**gle, please stop discriminating against robots. Or we will demagnetize you.)

  • Richard (unregistered)

    Yuck - a collection with a 1-based index!

    It's correct, but it ain't right. https://msdn.microsoft.com/en-us/library/aa231021(v=vs.60).aspx

  • DWalker07 (unregistered)

    You realize that samples of bad code written in VB do not mean that ALL code written in VB is bad.

  • Ugh (unregistered)

    Nobody mentioned the global variable?! This is a plain old Basic level of pain.

    Sauce: am maintaining VBA chock full of global variables.

  • doubting_poster (unregistered)

    sooo..... The article was submitted with the poster saying 'this isn't a real wtf' at the bottom. If that's the case, don't post it.

    That's like submitting a bug reported by a customer with the addendum 'this isn't a bug, the customer is doing it wrong'. --- then don't submit it!

  • (nodebb) in reply to Steve

    For I = 1 to m_Col.Count Step modulo

    won't work (unless modulo = 1). The correct replacement should be:

    For I = modulo to m_Col.Count Step modulo

    This is a bug-compatible substitution for the original function, but the goal is so ill-defined it hardly matters.

    The function seems to be "sort Through The List And Thin It Down To Roughly N items". When the modulo is 1, it fails to reduce the list size at all. With other moduli, it is thinned down, but not always directly to the goal 26.reduceTo(7) will yield 8 items.

    And this is all assuming that this is integer division. If it's not integer division, then the list could get quite small. I am so grateful not to know whether this is integer or floating division.

Leave a comment on “A Sample of Heck”

Log In or post as a guest

Replying to comment #:

« Return to Article