4 ms·
I've seen this first-hand both in interviewing and on the job. I expect it in interviews, but I never thought I'd see it from a colleague. I once worked with
by jofer 7y ago
I've seen this first-hand both in interviewing and on the job. I expect it in interviews, but I never thought I'd see it from a colleague.
I once worked with someone who refused to use loops. He would write everything out... Thousands of copy-pasted lines with incrementing values... He'd often insist that things only deal with certain numbers of inputs for this reason. E.g. he had a bulk data transfer tool that would only transfer 10 items. If you had less than ten, you had to make dummy files. If you had more than 10, you were supposed to use it multiple times. He was also considered "a key technical leader", and constantly lauded by management. He was in his late 20's and had a CS degree from a relatively well-known school. I'm a geologist, so I was constantly told I "just didn't know anything about programming" when I'd ask why. (I suspect he thought it was an optimization, but he never explained.)
This was at a company that's a household name (though not a tech company). I suppose the moral of the story is to be careful about assuming that experience implies a certain level of competence.
- andrewclunn 7y agoI really want this to not be true.
- kazinator 7y ago> E.g. he had a bulk data transfer tool that would only transfer 10 items. I would have pointed out that if you happen edit this tool to transfer 15 items, or any number more, the programming language still obligingly executes all of the larger program, which is because that language implementation contains loops for processing the tokens and statements.
- tempguy9999 7y ago> who refused to use loops. He would write everything out... Thousands of copy-pasted lines with incrementing values You're fucking joking us right? I've seen bad stuff but this is far, far beyond what I consider credible incompetence. You aren't serious? (Edit: you mention being a geologist. Happens something similar occurred - I was being uber'd by a geologist (he described himself thus) who could talk at length and very knowledgeably about the geopolitics of oil price and reservoir modelling, all fascinating stuff to me. But he mentioned a fossil that he could barely describe beyond being 'like a snail with bits coming off'. I offered that it was an ammonite and he seemed unfamiliar with the word. Also seemed to struggle to know what bauxite was when I raised it. I found those lacunae rather strange).
- jofer 7y agoIt's not quite as crazy as it sounds. It was a case of laziness and a belief that he was smarter than the compiler, rather than a lack of knowledge of basic flow control. For context, the "ten-item-only data transfer tool" was a plugin to a much larger piece of software with a Qt-based gui. He copy-pasted an example from the vendor that used a QLineEdit input widget ten times because he couldn't be bothered to look up how to use a QListWidget or something similar. The "avoidance of loops" I was referring to was mostly in the inner loops of volumetric image processing routines. A lot of things we worked on were domain-specific operations that are vaguely analogous to a convolution -- there's usually a moving window operation. He'd happily loop over the volume, but insist on writing the inner loop (the actual moving window) as repeated copy-pasted lines. He was basically doing manual loop unrolling, which could actually make sense in this context. (The codebase was C masquerading as C++.) However, the compiler was perfectly capable of optimizing a loop for the exact use cases he was working with. There was zero benefit manually unrolling a nested loop for a 5x5x11 or 3x3x7 window (in once case he did it for a 25x25x51 window -- 31k lines of C++... Generated with Perl... Yeah...) On the geology note, palentology is actually a fairly niche field. I wouldn't assume that every geologist has taken a paleo class. It's usually on the "take 3 of these 5" requirement list in undergrad, and it's not something you take at a graduate level unless that's your specialty. I certainly took a couple paleo/evolutionary biology classes, but it's useful for what I used to do. It wouldn't shock me if someone primarily doing reservoir modeling didn't know what an ammonite was.
- tempguy9999 7y agoAh, thanks for the loopy explanation. Actually any loop unrolling to that extent is counterproductive as it will simply burst the instruction cache, which causes expensive reloads from further down the cache hierarchy, whereas loops can be minimal or even zero overhead. I'd be really curious to know how much performance that cost. re. ammonites, ok, thanks for explanation!