3 ms·
>I can't help but wonder what that really means? My guess: it's the unfamiliarity of the mathematical modulus operator that trips most people up. A lot of CRU
by jasode 12y ago
>I can't help but wonder what that really means?
My guess: it's the unfamiliarity of the mathematical modulus operator that trips most people up. A lot of CRUD developers will never need to use modulus calculations in day-to-day work. Pull some values from a database record, throw it up on a form, then save it back. Use plus+ for totaling dollar amounts. Use multiply* for calculating sales tax. A LOB programmer can do stuff like that for years without modulus% anywhere in his code. Something like credit-card number validation does use modulus calc but programmers can just copypaste[1] someone else's example or just use a library.
However, a lot of these FizzBuzz discussions talk about computer science graduates specifically. A lot of CRUD devs do not have formal comp sci backgrounds so it's somewhat understandable that they're not familiar with modulus. However, I can't think of a reason why a compsci grad wouldn't know it.
[1]http://www.codeproject.com/Tips/515367/Validate-credit-card-number-with-Mod-algorithm http://www.codeproject.com/Tips/515367/Validate-credit-card-...
- dllthomas 12y agoEven if you're unfamiliar with the modulus operator, it's not that hard to test divisibility. C and sufficiently similar: x == k*(int)(x/k)
- xrange 12y ago>My guess: it's the unfamiliarity of the mathematical modulus operator that trips most people up. This is an interesting hypothesis, can anyone confirm that this is a particular sore spot? I wonder if that would show up as a generational gap? If the younger generations are working with web pages and never used much arithmetic, let alone remainders. But older generations grew up with low level graphics programming and arrays in languages like C and assembly where the modulus comes up all the time. So could we come up with the moral equivalent of FizzBuzz that a much larger percentage of the people who failed FizzBuzz could pass? And then I'd like to see how hard I'd think that test was.