• James (unregistered) in reply to Jani Mikkonen

    Damn I just had to do this last week with a legacy Informix 4GL / ACE report.

    Thank god there's only 12 months in a year.

  • (cs) in reply to rpjs
    rpjs:
    I once applied for a job with a bank that coded in PICK. Seeing this I'm glad I didn't get it!

    PICK BASIC has arrays.

  • (cs)

    What the fuck is this?

    What language is this?

  • DorfVader (unregistered) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    What the fuck is this?

    What language is this?

    English?

  • jordanwb (unregistered) in reply to DorfVader
    DorfVader:
    ObiWayneKenobi:
    What the fuck is this?

    What language is this?

    English?

    +1

  • BruceA (unregistered) in reply to DaveK

    Actually, it's the thirty-sixth count. There is no COUNT16.

    /pedantic

  • (cs) in reply to BruceA

    It looks to me like this guy wanted to count multiple different types of things without mixing up the counts for specific types of things until he explicitly adds them together at the very end. He could be using, for instance COUNT1 to store the number of shoes in stock, and COUNT2 to only store the number of socks in stock, where the total count returns the total number of all items in stock.

  • IV (unregistered) in reply to DaveK
    DaveK:
    jimlangrunner:
    I just want to cry when I see things like that, though. What the hell is Count37 supposed to be?
    Well, duh. It's the thirty-seventh count. I would have thought that was obvious. *rimshot*

    Or not. As some people have pointed out, 16 is missing. So 37 is at most the 36th (given the one indexing) without even looking to see if there are others missing.

  • (cs)
    Below is a search for the word "COUNT" in a single code file.
    The real WTF is that this must have been quite a non-standard version of grep that the output was produced by. I mean, a standards-compliant grep, when searching for the word COUNT in the source, would only have returned line 4991.

    Or could it be that they weren't searching for a word? </pedantic>

  • Snoofle (unregistered) in reply to Skizz
    Skizz:
    WORD1 = "ARRAY" WORD2 = "B" WORD3 = "EVEN" WORD4 = "F" WORD5 = "HAD" WORD6 = "S" WORD7 = "THE" WORD8 = "V" WORD9 = "What" WORD10 = "!" WORD11 = " "

    COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6

    WARNING****: WORD10 is declared, but never used.

  • John (unregistered) in reply to Chris
    Chris:
    Am I missing something... Arrays are not even needed; surely you could have replicated the code in the OP with just one variable?

    Well, given that much of the code is missing, we don't really know what is being counted. Perhaps the programmer hoped one day to display what all the individual counts were (specifically as the NO.ITEM suggests that each of these counts counts the volume of some (different) item...

    This was well thought out...Version two displays: COUNT14 = 9 COUNT37 = 7 etc....

  • Mitchell (unregistered) in reply to Pim
    Pim:
    Below is a search for the word "COUNT" in a single code file.
    The real WTF is that this must have been quite a non-standard version of grep that the output was produced by. I mean, a standards-compliant grep, when searching for the word COUNT in the source, would only have returned line 4991.

    Or could it be that they weren't searching for a word? </pedantic>

    It doesn't really look like grep to me (the /COUNT at the start I think is the actual search).

    Don't know about grep standards, but every version I've ever used would return all of those lines.... grep simply searches for the string you give it, it doesn't care about characters either side, so all of those lines would come up - but hey, as I say, I know nothing about standards, I just use it....

  • Punce (unregistered) in reply to pyro789x
    pyro789x:
    It looks to me like this guy wanted to count multiple different types of things without mixing up the counts for specific types of things until he explicitly adds them together at the very end. He could be using, for instance COUNT1 to store the number of shoes in stock, and COUNT2 to only store the number of socks in stock, where the total count returns the total number of all items in stock.

    It does, but the odd thing is he never seems to do anything with them. Come to think of it, he never does anything with COUNT either....

    Could this be shenanigans? What is the point of COUNT??? The last thing that happens to it, is it gets assigned a number - then we never hear from him again??? Is he never printed? Is he never used for another calculatio? WTF??

  • Old Fart (unregistered) in reply to DOA
    DOA:
    snoofle:
    ubersoldat:
    DaveK:
    Skizz:
    WORD1 = "ARRAY" WORD2 = "B" WORD3 = "EVEN" WORD4 = "F" WORD5 = "HAD" WORD6 = "S" WORD7 = "THE" WORD8 = "V" WORD9 = "What" WORD10 = "!" WORD11 = " "

    COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6

    It's funny you should say that, since I decoded your message by pasting it into my broswer's address bar.

    <a rel="nofollow" href="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);" target="_blank" title="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);">javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);

    OMG! I thought that was the best comment ever, but you Sir, were able to make it just more awesomely geek. Hands down for both of you.

    Seconded! You guys rock!

    I just like Davek's post. It's always nice when someone's willing to waste their time so you don't have to.
    Christ, you kids and ur ADHD excuses these days.... how fucking hard is it to glance at the concat, recognize #11 as \b char, skip elevensies to build an order in short term memory, and read the array in that order?

    It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter. daveK gets a win for being... prolifically... lazy. the rest of you link-clicking assholes sucking his dick should find another industry to leech off of.

  • rgz (unregistered) in reply to Peterke - pure copy paste

    That's exactly what I did, and talking about python, this article is a good example of why forced indentation is right, the code suggest a complexity that is not there.

    Arg I'm such a fanboy, I read my captchas immitto, as imoutto.

  • (cs) in reply to James
    James:
    What happened to Count16?
    The answer is Count42
  • You are a DICK! (unregistered) in reply to Old Fart
    Old Fart:
    DOA:
    snoofle:
    ubersoldat:
    DaveK:
    Skizz:
    WORD1 = "ARRAY" WORD2 = "B" WORD3 = "EVEN" WORD4 = "F" WORD5 = "HAD" WORD6 = "S" WORD7 = "THE" WORD8 = "V" WORD9 = "What" WORD10 = "!" WORD11 = " "

    COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6

    It's funny you should say that, since I decoded your message by pasting it into my broswer's address bar.

    <a rel="nofollow" href="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);" target="_blank" title="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);">javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);

    OMG! I thought that was the best comment ever, but you Sir, were able to make it just more awesomely geek. Hands down for both of you.

    Seconded! You guys rock!

    I just like Davek's post. It's always nice when someone's willing to waste their time so you don't have to.
    Christ, you kids and ur ADHD excuses these days.... how fucking hard is it to glance at the concat, recognize #11 as \b char, skip elevensies to build an order in short term memory, and read the array in that order?

    It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter. daveK gets a win for being... prolifically... lazy. the rest of you link-clicking assholes sucking his dick should find another industry to leech off of.

    WTF?

  • Herby (unregistered)

    This reminds me of a "programmer" who was put in charge of making a test rig. Using an Apple 2 (it was 1985 or so) he was to make 5 measurements, discard the high one and the low one, and average the other three. Using an array, this would have been quite simple (it was written in Basic for the Apple 2). NOPE. The process didn't use arrays, and with all the IF statements it took over TWO PAGES of programming to accomplish the task. A huge WTF if I ever saw one. While I did not re-code the problem, I figured that I could do this in about 10 lines of code (in Basic no less), not the over 150 lines that were actually used.

    Live & Learn!

  • rupert.h (unregistered)

    I wonder if it was an attempt at manual (or even a pre-processor doing) loop unrolling.

    Several years ago I had a subroutine which iterated over each bit in an I*04 (32 bit integer), performing some intrinsic function (XOR from memory (that's my memory)). The machine was pretty hot (for the time), the compiler was optimized for the architecture, and compiler optimization was set = all guns blazing. After profiling, it seemed this stupid bit manipulator subroutine was the long pole in the tent. The routine was so basic there was almost nothing to modify. As a last resort I unrolled the loop by hand - it ran twice as fast.

  • Old Fart (unregistered) in reply to You are a DICK!
    You are a DICK!:
    Old Fart:
    DOA:
    snoofle:
    ubersoldat:
    DaveK:
    Skizz:
    WORD1 = "ARRAY" WORD2 = "B" WORD3 = "EVEN" WORD4 = "F" WORD5 = "HAD" WORD6 = "S" WORD7 = "THE" WORD8 = "V" WORD9 = "What" WORD10 = "!" WORD11 = " "

    COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6

    It's funny you should say that, since I decoded your message by pasting it into my broswer's address bar.

    <a rel="nofollow" href="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);" target="_blank" title="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);">javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);

    OMG! I thought that was the best comment ever, but you Sir, were able to make it just more awesomely geek. Hands down for both of you.

    Seconded! You guys rock!

    I just like Davek's post. It's always nice when someone's willing to waste their time so you don't have to.
    Christ, you kids and ur ADHD excuses these days.... how fucking hard is it to glance at the concat, recognize #11 as \b char, skip elevensies to build an order in short term memory, and read the array in that order?

    It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter. daveK gets a win for being... prolifically... lazy. the rest of you link-clicking assholes sucking his dick should find another industry to leech off of.

    WTF?

    sigh

    Attention span preventing you from making it through the whole thought, then, is it?

    Let me make this clear for you:

    SUCK LESS.

  • (cs) in reply to Old Fart
    Old Fart:
    Christ, you kids and ur ADHD excuses these days.... how fucking hard is it to glance at the concat, recognize #11 as \b char, skip elevensies to build an order in short term memory, and read the array in that order?
    You just don't get technology, do you, granddad? The whole goddam' point of computers is to have them do the shitty gruntwork for you. That doesn't mean I don't use my brain, it means I use it for the more creative tasks that can't be automated. Sure, it aint that hard to do in your head, but it also aint that hard to bang two rocks together to make fire, yet you'd be an idiot to do it that way when you had a lighter sitting on the desk right next to you.
    Old Fart:
    It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter.
    I guess you must be an arthritic old fart then, because I can type fairly quickly!
  • Adrian Pavone (unregistered) in reply to Old Fart
    Old Fart:
    DOA:
    snoofle:
    ubersoldat:
    DaveK:
    Skizz:
    WORD1 = "ARRAY" WORD2 = "B" WORD3 = "EVEN" WORD4 = "F" WORD5 = "HAD" WORD6 = "S" WORD7 = "THE" WORD8 = "V" WORD9 = "What" WORD10 = "!" WORD11 = " "

    COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6

    It's funny you should say that, since I decoded your message by pasting it into my broswer's address bar.

    <a rel="nofollow" href="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);" target="_blank" title="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);">javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);

    OMG! I thought that was the best comment ever, but you Sir, were able to make it just more awesomely geek. Hands down for both of you.

    Seconded! You guys rock!

    I just like Davek's post. It's always nice when someone's willing to waste their time so you don't have to.
    Christ, you kids and ur ADHD excuses these days.... how fucking hard is it to glance at the concat, recognize #11 as \b char, skip elevensies to build an order in short term memory, and read the array in that order?

    It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter. daveK gets a win for being... prolifically... lazy. the rest of you link-clicking assholes sucking his dick should find another industry to leech off of.

    Not that I agree with you, but I did the manual substitution in my head when I came across the first comment without even knowing someone had done the javascript link further down. And I would have to say it took me longer to do than it would have taken to write the javascript snippet.

    However, the later poster is perfectly correct, computers are here to make our lives easier. I still use my brain, but for most routine, substitutional or calculation based tasks, even though I can do them myself (got a Bachelor in Mathematics), I prefer the computer does them for me. That's it's job.

    In short, because you old people lose track of the point after the story gets long: My job is to think and analyse. The computers job is to process.

  • marcan (unregistered) in reply to Peterke - pure copy paste

    I did the exact same thing. Good thing it's perfectly valid Python code. copy paste read. Easy.

  • (cs) in reply to Old Fart
    Old Fart:
    SUCK LESS.
    That's rich, coming from the crotchety old guy with no teeth and a pocket full of Werther's Originals!
  • Old Fart (unregistered) in reply to DaveK
    DaveK:
    Old Fart:
    SUCK LESS.
    That's rich, coming from the crotchety old guy with no teeth and a pocket full of Werther's Originals!
    Eh, what now, sonny? You want a candy? Sure thing, maybe it will overclock that useless lump between your ears... glad to hear your hands still work though... i must've used mine up about an hour after they started posting pr0n on the innertubes.... guess how i'm pecking this out right now...! *lechz*
  • Old Fart (unregistered) in reply to Adrian Pavone
    Adrian Pavone:
    Old Fart:
    DOA:
    snoofle:
    ubersoldat:
    DaveK:
    Skizz:
    WORD1 = "ARRAY" ...snip...

    Not that I agree with you, but I did the manual substitution in my head when I came across the first comment without even knowing someone had done the javascript link further down. And I would have to say it took me longer to do than it would have taken to write the javascript snippet.

    Try being smarter.
  • Isaac Eiland-Hall (unregistered) in reply to Old Fart
    Old Fart:
    Christ, you kids and ur ADHD excuses these days....

    Hi.

    I have ADHD, and I don't care for your flippant comments.

    I also object to you presenting yourself as a smarter "old guy" while typing shit like "ur".

    Furthermore, I walked the manual code in my head. And I have ADHD. So your petty characterization of people commenting on the javascripting or pythonning of the array fails on at LEAST two fronts. More, because I walked through it faster than I could have typed it, and I type 75wpm (I peak at 110-120wpm, depending on the method of test). So that's a bare minimum of three separate fronts you fail on.

    Furthermore, what the hell harm is there in making valid javascript to decode? To copy'n'paste into python's commandline interface? Does every little thing we do have to please you?

    No. I don't think so.

    So please go crawl back into your mother's basement and think before you speak again.

  • Old Fart (unregistered) in reply to DaveK
    DaveK:
    Old Fart:
    Christ, you kids and ur ADHD excuses these days.... how fucking hard is it to glance at the concat, recognize #11 as \b char, skip elevensies to build an order in short term memory, and read the array in that order?
    You just don't get technology, do you, granddad? The whole goddam' point of computers is to have them do the shitty gruntwork for you. That doesn't mean I don't use my brain, it means I use it for the more creative tasks that can't be automated. Sure, it aint that hard to do in your head, but it also aint that hard to bang two rocks together to make fire, yet you'd be an idiot to do it that way when you had a lighter sitting on the desk right next to you.
    Old Fart:
    It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter.
    I guess you must be an arthritic old fart then, because I can type fairly quickly!
    You clearly have never tried to start a fire by banging rocks together. Also, you're the only person who got a pass, because you actually lazied properly. I was just fed up with the little sycophants sucking your dick for being so SMRT. Sorry to get between you and the praise of morons, davek; I've been pleasantly surprised by your posts in the past, myself.
  • Old Fart (unregistered) in reply to Isaac Eiland-Hall
    Isaac Eiland-Hall:
    Old Fart:
    Christ, you kids and ur ADHD excuses these days....

    Hi.

    I have ADHD, and I don't care for your flippant comments.

    I also object to you presenting yourself as a smarter "old guy" while typing shit like "ur".

    Furthermore, I walked the manual code in my head. And I have ADHD. So your petty characterization of people commenting on the javascripting or pythonning of the array fails on at LEAST two fronts. More, because I walked through it faster than I could have typed it, and I type 75wpm (I peak at 110-120wpm, depending on the method of test). So that's a bare minimum of three separate fronts you fail on.

    Furthermore, what the hell harm is there in making valid javascript to decode? To copy'n'paste into python's commandline interface? Does every little thing we do have to please you?

    No. I don't think so.

    So please go crawl back into your mother's basement and think before you speak again.

    ur so deliciosly full of FAIL, and u don't even know it...

  • (cs) in reply to Old Fart
    Old Fart:
    DaveK:
    Old Fart:
    SUCK LESS.
    That's rich, coming from the crotchety old guy with no teeth and a pocket full of Werther's Originals!
    Eh, what now, sonny? You want a candy?
    JESUS CHRIST IT'S PEDOBEAR GET IN THE CAR!
    Old Fart:
    Sure thing, maybe it will overclock that useless lump between your ears... glad to hear your hands still work though... i must've used mine up about an hour after they started posting pr0n on the innertubes.... guess how i'm pecking this out right now...! *lechz*
    Presumably with the useless lump between your legs.
  • (cs) in reply to Old Fart
    Old Fart:
    You clearly have never tried to start a fire by banging rocks together.
    You clearly still do!
    Old Fart:
    Sorry to get between you and the praise of morons, davek;
    I don't need anyone's praise, you were just being a grumpy old git.
    Old Fart:
    I've been pleasantly surprised by your posts in the past, myself.
    I don't need your praise either. I'm really not all that insecure.
  • SeanJA (unregistered)

    I have worked on some code that looked like that... not to that extreme though...

  • Kelly (unregistered)

    This reminds me of an early-90's database technology I had to support. It wasn't paradox but it was billed as 'just like paradox'. The guy who brought in the database tool had no programming training, all the variables were names of baseball teams. His understanding of any sort of code management or debugging was was epic. We suspected that he paid the vendor to write all the code because when we gave him a simple app to write, he struggled with simple loops and variable assignments. Granted 'C' isn't the easiest language to learn but no one ever accused "for(int i; i <= 10; i++);" loops as advanced programming.

    Kelly http://codewright.blogspot.com/

  • (cs) in reply to Kelly
    Kelly:
    Granted 'C' isn't the easiest language to learn but no one ever accused "for(int i; i <= 10; i++);" loops as advanced programming.

    Kelly http://codewright.blogspot.com/

    No, not that. It's just very implementation dependent. If it's meant to be C, most compilers would refuse to compile this because of the int in the statement. Others would fail because i isn't declared a start value. Yet others would initialise i to 0, and some would leave i with a random start value. With or without warnings. Oh, and there may even be compilers that optimise the whole loop away and just substitute i = 11;.

  • (cs) in reply to Mitchell
    Mitchell:
    Pim:
    Below is a search for the word "COUNT" in a single code file.
    The real WTF is that this must have been quite a non-standard version of grep that the output was produced by. I mean, a standards-compliant grep, when searching for the word COUNT in the source, would only have returned line 4991.

    Or could it be that they weren't searching for a word? </pedantic>

    It doesn't really look like grep to me (the /COUNT at the start I think is the actual search).

    Don't know about grep standards, but every version I've ever used would return all of those lines....

    Yes, if they didn't tell grep to look for whole words. If they would have been looking for words, like the article says, a search would not match words like, for instance, COUNT12, because the word COUNT12 is not equal to the word COUNT. See? Now, would you allow me to leave pedantic mode? TIA.

  • Anonymous (unregistered) in reply to Isaac Eiland-Hall
    Isaac Eiland-Hall:
    I have ADHD
    Can I get some of your methamphetamine hyper boy?
  • (cs) in reply to DaveK
    DaveK:
    jimlangrunner:
    I just want to cry when I see things like that, though. What the hell is Count37 supposed to be?
    Well, duh. It's the thirty-seventh count. I would have thought that was obvious. *rimshot*
    Well yes, but if you're making THIRTY-SEVEN counts, then something is badly wrong with your AlGorerithm.
  • (cs) in reply to Herby
    Herby:
    This reminds me of a "programmer" who was put in charge of making a test rig. Using an Apple 2 (it was 1985 or so) he was to make 5 measurements, discard the high one and the low one, and average the other three. Using an array, this would have been quite simple (it was written in Basic for the Apple 2). NOPE. The process didn't use arrays, and with all the IF statements it took over TWO PAGES of programming to accomplish the task. A huge WTF if I ever saw one. While I did not re-code the problem, I figured that I could do this in about 10 lines of code (in Basic no less), not the over 150 lines that were actually used.

    Live & Learn!

    Even without arrays, I'm not sure it should take over 150 lines. Maybe we have a coder challenge here? Perform the described task using as few statements as possible, without using arrays.

  • Arnold (unregistered)

    very nize, i always makes m like that!

  • (cs)

    I call shenanigans. Even Miranda had array-like structures FFS.

  • (cs) in reply to Old Fart
    Old Fart:
    Christ, you kids and ur ADHD excuses these days.... how fucking hard is it to glance at the concat, recognize #11 as \b char, skip elevensies to build an order in short term memory, and read the array in that order?

    It probably takes less time than copying, pasting into notepad, deleting carriage returns, adding docwrite, copying, pasting into URL bar, and hitting enter. daveK gets a win for being... prolifically... lazy. the rest of you link-clicking assholes sucking his dick should find another industry to leech off of.

    You don't need to fucking kill everyone who writes better code than you, Mr. Balmer.

  • xapp (unregistered)

    1722

  • Buddy (unregistered) in reply to m0ffx

    [quote user="m0ffx"] Live & Learn![/quote]Even without arrays, I'm not sure it should take over 150 lines. Maybe we have a coder challenge here? Perform the described task using as few statements as possible, without using arrays.[/quote]

    In C, can do it in two functions and twelve semi-colon terminated statements (forward declarations, braces, comments and spaces don't count).

    void swap(double *a, double *b);

    double measure(double a, double, b, double c, double d, double e) { if (a < b) swap(&a, &b); if (a < c) swap(&a, &c); if (a < d) swap(&a, &d); if (a < e) swap(&a, &e); /* a is maximum */

    if (b > c) swap(&b, &c);
    if (b > d) swap(&b, &d);
    if (b > e) swap(&b, &e);
    /* b is minimum */
    
    return (c + d + e) / 3.0;
    

    }

    void swap(double *a, double *b) { double t;

    t = *a;
    *a = *b;
    *b = t;
    

    }

  • Logo (unregistered) in reply to DaveK
    DaveK:
    Old Fart:
    SUCK LESS.
    That's rich, coming from the crotchety old guy with no teeth and a pocket full of Werther's Originals!

    Ok, I enjoyed the constructed comment and all but the Werther's Originals reference made me lol way more.

  • Mike (unregistered)

    One, two, another one, another one...

    It's like a bad episode of Sesame Street, Count von Count on a caffeine rush.

  • Wyrd (unregistered) in reply to DaveK
    DaveK:
    Skizz:
    WORD1 = "ARRAY" WORD2 = "B" WORD3 = "EVEN" WORD4 = "F" WORD5 = "HAD" WORD6 = "S" WORD7 = "THE" WORD8 = "V" WORD9 = "What" WORD10 = "!" WORD11 = " "

    COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6

    It's funny you should say that, since I decoded your message by pasting it into my broswer's address bar.

    <a rel="nofollow" href="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);" target="_blank" title="javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);">javascript:WORD1 = "ARRAY"; WORD2 = "B"; WORD3 = "EVEN"; WORD4 = "F"; WORD5 = "HAD"; WORD6 = "S"; WORD7 = "THE"; WORD8 = "V"; WORD9 = "What"; WORD10 = "!"; WORD11 = " "; COMMENT = ""; COMMENT = WORD9 + WORD11 + WORD7 + WORD11 + WORD4 + WORD11 + WORD3 + WORD11 + WORD8 + WORD2 + WORD11 + WORD5 + WORD11 + WORD1 + WORD6; document.write(COMMENT);

    That's way cool. You rule.

    -- Furry cows moo and decompress.

  • (cs) in reply to DaveK
    DaveK:
    Buddy:
    [ ... ] so arrays were a luxury. [ ... ]
    InB4 Monty Python sketch.

    It may be spelled "a r r a y s" but it's pronounced throat-warbler mangrove!

  • Iago (unregistered)
    Karaken12:
    all of them have had arrays, commons, loops -- basically everything you need for a half-decent functional programming language.
    Most functional programming languages prefer lists rather than arrays, and prefer recursion rather than loops.

    You are probably thinking of procedural programming.

  • Some Jerk (unregistered)

    I might point out that so long as strings exist, arrays are always possible (if not beautiful).

    Arrays can be built into any sequential charictar datatype, one example of such is: [addTabLen] < - 4 bytes (integer) [addIndex] < - 4 bytes (integer) - repeate for each element [element] < - ? bytes (byte) - repeate for each element.

    Although, nobody in their right minds would build it if they didn't have to... I cannot imagine what would cause someone to write that mess.

    CAPTCHA: saluto ( spanish: Health at risk due to alcohol consumption )

  • Jay (unregistered) in reply to Buddy

    [quote user="Buddy"][quote user="m0ffx"] Live & Learn![/quote]Even without arrays, I'm not sure it should take over 150 lines. Maybe we have a coder challenge here? Perform the described task using as few statements as possible, without using arrays.[/quote]

    In C, can do it in two functions and twelve semi-colon terminated statements (forward declarations, braces, comments and spaces don't count).

    void swap(double *a, double *b);

    double measure(double a, double, b, double c, double d, double e) { if (a < b) swap(&a, &b); if (a < c) swap(&a, &c); if (a < d) swap(&a, &d); if (a < e) swap(&a, &e); /* a is maximum */

    if (b > c) swap(&b, &c);
    if (b > d) swap(&b, &d);
    if (b > e) swap(&b, &e);
    /* b is minimum */
    
    return (c + d + e) / 3.0;
    

    }

    void swap(double *a, double *b) { double t;

    t = *a;
    *a = *b;
    *b = t;
    

    } [/quote]

      static int max(int a, int b)
      {
        return a>b ? a : b;
      }
      static int min(int a, int b)
      {
        return a
    

    Three functions, 5 semi-colon'ed statements! If I'm allowed to use the library functions Math.max and Math.min, then I could do it in 3 lines!

    If readability is not scoring criterion, I can name that tune in one line:

      static int avg5b(int v1, int v2, int v3, int v4, int v5)
      {
        return (v1+v2+v3+v4+v5
          -Math.max(v1,Math.max(v2,Math.max(v3,Math.max(v4,v5))))
          -Math.min(v1,Math.min(v2,Math.min(v3,Math.min(v4,v5))));
      }
    

    Not that I doubt that someone wrote 150 lines of code to accomplish this.

Leave a comment on “A Man's Array”

Log In or post as a guest

Replying to comment #245891:

« Return to Article