Re:“About one-third of Basecamp employees accepted buyouts t...
by phendrenad2 on Saturday May 01, 2021 @10:28AM
(#27006589)
I've had to use it too - mostly when faffing about and not using some jQuery builtin. But to say that someone who doesn't know this easily-stackoverflowed ("how do I do something every nth array item") lacks basic programming ability ("why can't programmers program" is I think the original fizzbuzz blog post title) is I think going too far.
That may be true, but as a web dev, I use the modulo quite frequently. Just yesterday I used it to implement some code where the client wanted to insert ads after every sixth paragraph in a page body, but not if there would be two paragraphs or less left on the page after the last ad. I can't imagine what kind of goofy hackneyed solution I would have ended up with if I didn't know about `%`.
Before CSS had :even and :odd pseudoselectors, we also commonly used it to zebra stripe tables.
Web dev isn't typically as math-y as, say, game dev, but I'd encourage anyone getting into it to at least learn the modulo beyond basic algebra stuff.