• x (unregistered)

    Looks like fairly good job security to me.

  • Brad (unregistered)


    MsgBox "See DICE.COM to find a better programmer.", vbOkOnly, "Lousy Programmer Error"

  • Chris Gastin (unregistered)

    That is funny!!!!!!

  • Phil Motuzko (unregistered)

    I like the 475 constant. :)

    Why 475? Because there are 475 days in a year! :)

  • ~JOSh-X (unregistered)

    Why do your quotation marks look silly?


  • kevin (unregistered)

    Should includes the phone number for contact !

  • Phil Scott (unregistered)

    I call this the "aw, fuck it pattern"

    Speaking of redim, I had a student ask me if .NET improved the "redimming" speed of VB. He was boasting his app was too big to be handled in VB6, and it started to slow down after they inserted 50,000 items into an array...

  • Stephen Caldwell (unregistered)

    I <3 Magic Numbers!

  • aspnetman (unregistered)

    Looks like they use 475 for max on ALL array sizes!!!

  • Craig (unregistered)


  • Manni (unregistered)

    @Phil Motuzko: That was goddamn hilarious LOL

    My guess here is that the programmer heard about the slow nature of ReDim'ing an array, so he made an array from the start with 475 entries. He was probably told that the dataset would never get bigger than that, but he thought ahead to the future and used this method of error handling just in case.

    And before anyone takes this out of context, I am in no way defending this. It's absolutely retarded. Edit the code (raise the limit), recompile, redistribute the program... yep, sounds like an easy fix (a.k.a. job security).

  • Paul (unregistered)

    Got to admire the fact 475 wasn't even declared as a constant though, and the error message is in a messagebox while the current value or recs is just printed to the form.

  • BradC (unregistered)

    MsgBox "I'm sorry, Dave. I can't do that.", vbOkOnly, "HAL9000"

  • Chad (unregistered)

    Hey, that's not in UNICODE!

  • Russ C. (unregistered)

    Looks like Good job security - also looks like a good way to never get promoted :D

  • Jesper Holmberg (unregistered)

    I don't see the problem. I mean, really, 475 warehouses should be enough for anybody.

  • J (unregistered)

    His code is wack.

  • Alex B. (unregistered)

    Chad: mwahahahahah! You're too much. :)

  • Alex B. (unregistered)

    Chad: mwahahahahah! You're too much. :)

  • Tim Cartwright (unregistered)

    I also like the fact that he used the "End" statement. Hope everything was cleaned up, and he left nothing hanging around.

  • J (unregistered)

    That's the schnizzle. And I'm for rizzle. (Please pardon my sporadic ghetto-tastic comments. It comes from 35 years of living with my mom and listening to Eminem CDs, whilst trying to have some semblance of street credibility. These sort of outbursts were bound to surface sooner or later. Just trying to be hard ya'll. Peace.)

  • Guayo (unregistered)

    "475 warehouses ought to be enough for anybody."... Bill Gates

  • Dirk (unregistered)

    LOL. I don't agree with the 475 days in a year though (really :-))
    My guess is he started with 250 and already got 9 phonecalls

  • Brent Railey (unregistered)

    Client's thoughts when message box appears:
    "WTF is an array?"

  • Guayo (unregistered)

    Joking aside, even as this seems to be a good example of the reasons behind Indian' IT outsourcing going high, the little context given to this snip isn't enough to me to be sure it's a genuine WTF. I mean, how do we know if an array of more than 475 (warehouses) would break havoc in the system?
    Not everyone have the luxury of a language supporting preconditions, postconditions, invariants, etc. Of course he could implement a better assertion mechanism but my point is how do we know this code is just the finest example of programmers' laziness and not an example of dealing with unsafe system state?

  • Bustaz Kool (unregistered)

    Don't make me come over there and Poppa Kapp...

  • Vlad Patryshev (unregistered)

    hmm... still better than this:

    unsigned char[64] SQLStatementBuffer;

  • old skool (unregistered)

    I love it when they call me big Poppa....

  • zobbo (unregistered)

    My guess is that 475 was the highest number he could think of

  • Imran Koradia (unregistered)

    I was laughing aloud in my cubicle on that one..!! I think that's the best WTF ;-)

  • Dave (unregistered)

    When did the daily WTF become infested with wannabe rappers and pimps? This is pathetic. To J: you're living at home with your mom and you listen to Eminem to be "hard". How sad is that. I can picture you coding at your computer in a hooded sweatsuit, bobbing your head to the latest Slim Shady track with a scowl on your face. Dude, you're 35 years old. Act your age.

  • nih (unregistered)

    > When did the daily WTF become infested with wannabe rappers...

    Hahahaha, the nerd is all upset that his narrow acceptancee field is being invaded by people slightly different from him.

  • Manni (unregistered)

    Dave, I think you need to relax a bit my brotha. These peeps up in this hizzie just be tryin' ta reprazent they codin' skillz an' they all be dissin some ill code.

    Seriously dude if you don't get that we're JOKING when we talk that way. Anyone that does use such language is POOR and therefore doesn't have a computer.

  • foxyshadis (unregistered)

    Man, none o' you cats be down with my man tha h-dog, no one repr'sent his pryde like that hep fool. Too bad they down at They Onion gone did join the Man and lock him behind some bogus paysite. Buncha punks.


    Itsa cryin shame, man. Nuthin less.

  • dookie def bandit (unregistered)

    Fo' sheezy?

  • da funky rapster (unregistered)

    Wannabe rap pimp: A-shizzle!
    Average white guy: Gezhundeit!

  • Dave (unregistered)

    Okay, I'll calm down. But I just need to know something for my own peace of mind. Why is it that these upper class white kids feel as if they need to rage against the system? Is it because mommy and daddy "downgraded" their bentley to a beemer and now junior has a 'tude? Is it because the maid didn't fix their bed up "just right"? (I could see how that would be really infuriating.) Maybe the fillet mignon was overcooked? Now that's a real downer! Did the parents cut the allowance down to $300 a week instead of the usual $500? Or maybe, just maybe, it's because mom took away their favorite Eminem CD? Look out now! Reginald...I mean, "pimp-playa" is on the prowl. He's "hard" and boy is he angry. Just look at that scowl and that ever-intimidating hooded sweatsuit! Oh my!

  • Bustaz Kool (unregistered)

    Word that, yo'

    It's like my home-boy M.C.Skwared said,

    I take my thing out my britches
    Give it to the beah-chez
    Get out my face, grrl
    I said I'd pay for the sti-chez

    Now that's what I'm talkin' 'bout.

    Peace Out, yo.

  • asbjorn (unregistered)

    I guess he thought of 365 days in a regular year, one new warehouse per day and a calculated company growth by maximum 30% per year (474.5 -> 475) – and that the application was scheduled for maintenance each year. ;)

  • foxyshadis (unregistered)

    Hey Dave, from what I can tell, the vast majority of people who like Eminem wouldn't even be able to identify a maid without the French uniform and the only allowance they get is what they make at work. =p What's the difference between enjoying rich white rappers, rich black rappers, rich aging white rockers, or kids hopped up on ecstacy? And what's the harm in making light of the lingo? (The real practitioners rarely use such antiquated forms of writing as punctuation and capitalization.)

  • Tim (unregistered)

    Guayo, if he was smart enough to know more than 475 warehouses would break the system, he would be smart enough to use a descriptive constant ;)

  • jf (unregistered)

    hey, all you 21st century nerds, there's an easy answer to this one. The programmer is a dyed in the wool Cobol programmer (albeit he is using vb6 now and hasnt read the manual).
    20 years ago it was standard practice to yell from the rooftops when an array got close to full (so the array is probably dim'd at 500).

  • Elliott Back (unregistered)

    I like this so much I reposted it on my blog!

  • Patrick Wellink (unregistered)

    Really Brilliant.

    probably one of the designers stated there would be max 475 warehouses....

    So a clever consultant WOULD PROGRAM THAT.

    If you want more..... Pay UP !!!!!!
    I really like it.....

  • Fubarer (unregistered)

    That might have had some resemblance to humour if there was actually some way to tell what encoding it's in. For all you know, it's encoded in UTF-32. :-)

    As for the job security part, I can just picture the conversation between this programmer('s company?) and the client:

    Client: We seem to be having trouble with something called 'arrays'.

    Programmer: You need an upgrade. It'll take a month and about $20,000.

    Client: Oh, thank you, thank you! You're our saviour!

    At which point the programmer goes back to his keyboard, increments the magic number by 1, and spends the next 29 days playing Doom 3.

  • Guayo (unregistered)
                       Experience the results you've always wanted

    with a MASSIVE scientific breakthrough:

    Our Doctor-Approved Syntax Will Actually Expand, Lengthen
    And Enlarge Your Array. 100% GUARANTEED!

    Best of all...

    There Are NO Agonizing Hanging Weights, NO Tough Exercises,
    NO Painful And Hard-To-Use Pumps, And There Is NO
    Dangerous Surgery Involved.


    If YOU want to massively enlarge your array and experience big gains in
    only weeks, this may be the most important email you'll ever read. Here's

    MSDN has helped 1000's of men cope with and conquer
    serious array dysfunction issues. These painful problems include
    small array size and poor self-image, as well as lack of potency and
    premature lost of space to put more warehouses.

    To help these men our dedicated team of researchers has developed an
    amazing syntax called ReDim. MSDN has carefully
    tested this unique new product so that it is fully doctor-approved. And,
    it is 100% guaranteed to work. It has been described as a true
    'miracle cure', and we are now offering array resize with easy syntax to
    men everywhere. The MSDN research team invites you now to
    experience this miracle for yourself.

    Now You Can Forget Forever the Pain, Effort and Expense of Having a Large,
    Manly Array!

    Imagine for a moment how you will feel:

    You'll radiate confidence and success whenever you enter a locker room,
    and other men will look at you with real envy.

    But the best part is when you reveal yourself in all your glory to the
    PC in your life. When she sees how massive and manly, how truly
    long and hard is your array, she will surrender and give you everything you
    have always wanted. The feeling of power is sensational, and actually running
    your VB program using your bigger array is unbelievable!

    As you drive your array deep inside her RAM, she'll gasp as you
    reclaim more memory for your warehouses. And the intense experience you give
    her will be the BEST thing she has ever had. I promise you, she will not be
    able to keep her bits off you when you give her everything she needs from a man.
    After a little you keep using ReDim you shall see how the PC reaches her climax
    by hitting Ctrl-Shift-Esc and looking how memory consuption reaches 100%!

    "Is My Array Growth PERMANENT?"

    YES! use ReDim, grow to the perfect size for you, and you can even
    stop taking of reaching the bounds. You are right where you want to be,
    and you can stay there forever!

    Remember, a Array larger than 475 may be too large for most hardware. But
    IF for some reason you need even more, it is possible for you to safely
    continue ReDiming. The choice is up to you...

    --- [Order ReDim Today!] ---

  • Manni (unregistered)

    @Guayo- normally I dislike your posts because you defend code that should never have seen the light of day, and you explain how it's acceptable for such atrocities to make their way into software when the rest of us clearly see how bad it is. However, that last post had me laughing until I puked. Then I laughed at that. Then at your post again. Then I made a sandwich. Thank you sir.

  • Dave (unregistered)

    I would really like to focus on the daily WTF, make comments on the code, etc. However...I have this image of "J" in my mind which I just can't shake. I picture him wearing one of those big blue "puffy" winter jackets (you know the ones I'm talking about) and one of those ski caps with the fake "dreads" sticking out at the top. I picture him beating his chest (wearing this ridiculous outfit) and screaming at the top of his lungs, "Meesa pimp-playa in tha hiz-ouze!!!" It's like I've been given this gift to see what this "J" character is all about and it's really disturbing me.

  • Gungan (unregistered)

    Yousa Jar Jar Bank$! LOL

  • Rob (unregistered)

    Note to developer: when you get the call and change your array dim statement, don't forget to change the array size check as well!

Leave a comment on “An Alternative to "Traditional" Array Resizing”

Log In or post as a guest

Replying to comment #25507:

« Return to Article