Dis-array



  • Today, I was looking in some documentation to find limits. Some software of course has finite, hardcoded limits in many things, such as the number of digits in a NUMERIC type in a database, the number of CPUs supported, etc.

    This reminded me of something that happened back in the early days of my career, when I only had about 2 years of programming experience.

    One of my coworkers ran up against a compiler limit, and began to gripe to me. He was beyond annoyed...

    "This #$$^ piece of %^$ compiler is $^&$ worthless! It's written by $#%# stupid #$%$!!" He informs me he's reached the limit for the number of variables allowed in one program.

    The maximum number of variables being 32,767, I stared at him and blurted out, "HOW?!"

    Looking at his code, I find something that, in pseudocode, looks like this:

    function set_number_array (position, number)
    if position == 1
        number_1=number
        return
    end if
    if position == 2
        number_2=number
        return
    end if
    ...
    end function
    

    He had a ton of functions like this, which handled several arrays, some of which were 2,000 to 3,000 elements each. He'd written code in -another- language to take advantage of for-next loops: to spit out code in what we were using, so that he could have arrays... This also explained why he was constantly complaining about the poor execution speed of anything he wrote with that compiler-- blaming the compiler, of course...

    Me teaching him about arrays turned out to be his parting gift. Our boss was beyond livid at the time wasted by the guy who was constantly going on about how he was the best programmer in the office, and so he was let go quite rapidly after my rolling on the floor laughing attracted attention. :)



  • if (post_count == 1)
       post_1 = "FIRST!";



  • When I hear stories of programmers that think "I am the greatest coder that ever lived," I am always reminded of the knowlege circles.  If all of your knowledge is contained within a circle, then all that you perceive to not know lies on its circumference.  Clearly, the more knowledge you have, the more you are able to perceive how much you don't know.  Given this argument, this wunder-coder's circle-of-knowledge is a point.

    As an aside, I am quite interested in knowing what that guy's credentials were.  I have a feeling it consists of trade school and a couple of certifications.



  • @communist_goatboy said:

    Given this argument, this wunder-coder's circle-of-knowledge is a point.

     

    I love one-dimensional coders. The OP reminds me of the story behind one of my predecessors where I work. Apparently, the guy didn't understand what structs or classes were, nor did he believe in their usefulness. I believe his argument was that it was much faster to use parallel arrays of primitive types, or something. He was quickly fired, and his code was scrapped. We just don't tolerate that kind of nonsense where I work, and thank heavens.



  • @indigodarkwolf said:

    I love one-dimensional coders. The OP reminds me of the story behind one of my predecessors where I work. Apparently, the guy didn't understand what structs or classes were, nor did he believe in their usefulness. I believe his argument was that it was much faster to use parallel arrays of primitive types, or something. He was quickly fired, and his code was scrapped. We just don't tolerate that kind of nonsense where I work, and thank heavens.

    I've got a -ton- of stories like this. I often do budget work-- I usually prefer working for smaller companies than larger ones. They have less money to pay me but it's much more common that I can get them to actually listen to me. But this usually means I'm replacing someone who charged little because he sucked, or couldn't get much because he had no experience, etc... Well, the guy the original post was about? I've encountered his code a total of 4 times besides the first one I wrote about. He never did get much better...

    Parallel arrays are slightly forgivable if the person dates back enough years. But only slightly, and only at all if they spent most of their career working in languages that didn't have structs or an analog. (And there's not that many languages that don't have a better solution.) Anyone coming from such a background who looks at structs and says anything other than, "What a great idea!" or words to the same effect... is an idiot.



  • I wonder, what language doesn't have proper arrays? I mean, he went to great lengths to simulate arrays, so he must've known the concept and the only explanation for this would be that he learned programming in a language from before arrays were invented. Or am I being too optimistic and it is indeed possible to "learn" a programming language without bothering to check the basic datatypes?



  • @Ilya Ehrenburg said:

    I wonder, what language doesn't have proper arrays? I mean, he went to great lengths to simulate arrays, so he must've known the concept and the only explanation for this would be that he learned programming in a language from before arrays were invented. Or am I being too optimistic and it is indeed possible to "learn" a programming language without bothering to check the basic datatypes?

    I'm pretty sure all languages either have arrays or are low-level enough that you can build them yourself (Excluding stuff like whitespace etc, though I think even that can have arrays as a concept just not as a construct).

    Plus I don't think any language without arrays is really a beginner language. Such a fundamental thing is necessary in any training.



  • @indigodarkwolf said:

    @communist_goatboy said:

    Given this argument, this wunder-coder's circle-of-knowledge is a point.

     

    I love one-dimensional coders.

     

    A point has zero dimensions. 



  • Re: Dis-array Or Large Array in Memory -> More Memory != Improved algorithm

    @Wolftaur said:

    Today, I was looking in some documentation to find limits. Some software of course has finite, hardcoded limits in many things, such as the number of digits in a NUMERIC type in a database, the number of CPUs supported, etc.
    This reminded me of something that happened back in the early days of my career, when I only had about 2 years of programming experience.

    Reminds me of one of the first Systems/Business Analyst jobs I had.  The scenario was this: Shop used IBM System 3 Mod 15.  All work was doen in RPG II.  I was working on another major new project, but had attended a staff meeting where I heard "We have to do some budget cuts because we have to buy enough more memory to run payroll..."  The Federal Government had changed the wage withholding tables.  The trade school programmer who was on the home-grown payroll HAD LOADED THE ENTIRE WITHHOLDING TABLE BOOK INTO MEMORY.  There was not enough memory to handle the increase in the FWHG table, so they were looking at a whole bunch of money to at least double the memory. 

    I piped up and said that I thought that we could save the whole cost of the memory upgrade by changing the payroll calculation program.  Dumbfounded looks all around the meeting table. "no way!", "How?", "We have to have the memory to do it..."  I stepped out of the meeting, went down to the accounting department and got a copy of the Federal Withholding book from the payroll clerk.  Brought the book back to the meeting, flipped it open to the pages on onte computation of withholding and told them: "See, you don't have to use a big table to do this, you can just build withholding computations for each type of payroll.  You can also do it for the State withholding too!"

    Of course, when I, as "Smartass College Boy" showed up the trade school guy and his community college (not completed) boss (mine too), besides derailing the hardware goodies (the Controlller liked my idea) my days there were numbered.  But that is another story....



  •  @indigodarkwolf said:

    @communist_goatboy said:

    Given this argument, this wunder-coder's circle-of-knowledge is a point.

     

    I love one-dimensional coders. The OP reminds me of the story behind one of my predecessors where I work. Apparently, the guy didn't understand what structs or classes were, nor did he believe in their usefulness. I believe his argument was that it was much faster to use parallel arrays of primitive types, or something. He was quickly fired, and his code was scrapped. We just don't tolerate that kind of nonsense where I work, and thank heavens.

    Yeah I get the same kind of joy here where I work.  Apparently the coder before me knew OF Struts, but didn't realize that Struts had its own set of tags that could be used. No no no, she thought it was WAY better to have 100% scriptlet goodness instead of using the logic or iterate tags, or perhaps even an HTML:OPTIONS with some ListValuesBeans.  Lovely :)



  • @indigodarkwolf said:

    I believe his argument was that it was much faster to use parallel arrays of primitive types, or something. He was quickly fired, and his code was scrapped. We just don't tolerate that kind of nonsense where I work, and thank heavens.

    @Wolftaur said:
    Parallel arrays are slightly forgivable if the person dates back enough years.
     

    Actually, they're the latest and greatest programming technique, or you could say that their time has come round again.  Neither of you two have any experience of vector or SIMD programming, by any chance?  Parallel arrays of primitive types are very frequently the optimal way to implement parallelised algorithms when the only factor limiting your computation throughput is the cpu to memory bandwidth and the only thing you have to help you is an ordinary line-based set-associative L1/L2 cache.

    This of course doesn't invalidate your point that anyone who's never even heard of structs is an idiot, but it does invalidate the implied conclusion that parallel arrays are never a valid programming technique.



  • @curtmack said:

    @indigodarkwolf said:

    @communist_goatboy said:

    Given this argument, this wunder-coder's circle-of-knowledge is a point.

     

    I love one-dimensional coders.

     

    A point has zero dimensions. 

     

    Perhaps if he puts a hand in at each side and pulls as hard as he can, he could turn it into a goatse of knowledge?  



  • @DaveK said:
    Perhaps if he puts a hand in at each side and pulls as hard as he can, he could turn it into a goatse of knowledge?


  • @DaveK said:

    Neither of you two have any experience of vector or SIMD programming, by any chance?

    This of course doesn't invalidate your point that anyone who's never even heard of structs is an idiot, but it does invalidate the implied conclusion that parallel arrays are never a valid programming technique.

    Sounds like shaders/rendering work. Fair enough. There are many programming tools which all have their uses. Fortunately, I'm not in that position, and unfortunately for my predecessor, neither was he. :P



  • @TwelveBaud said:

     

    <pic>
    Oh well done sir!  You win an internets!

Log in to reply