News for hackers. Stuff that matters.
Re:A Bit Overcomplicated by sudhirj on Thursday August 05, 2021 @09:58AM (#28073816)
It simply hasn't come up. I've written accounting and billing software that processes millions without using bit shifting, logistics solvers that do multithreaded depth first search systems on lazy graphs without bit shifting, ticketing systems that sold millions of tickets correctly without bit shifting etc.

I'm sure there are plenty of use cases out there, I just haven't worked on them.

Re:A Bit Overcomplicated by hnick on Thursday August 05, 2021 @08:20PM (#28081766)
Would you have recognised the opportunity to use it, not knowing how it works?

Sometimes when we learn a new technique we suddenly see all the places it can be used that we didn't know about before. There's the old (probably apocryphal) story about the landscaper who was able to fire one of his staff when a customer told him he can calculate the side of a right-angled triangle without measuring all 3 sides. What he did worked for him, he just didn't know there was a better way.

Anyway I do agree in this case you are probably correct. I think most programmers these days use bitwise logical operators for flags and rarely if ever bit shift outside of system code.

Re:A Bit Overcomplicated by sudhirj on Friday August 06, 2021 @02:09AM (#28083847)
I almost had to learn it once for flags, but Go has iota and constants and Java has enums, and stuffing flags into an integer and storing that in Postgres or Redis would have made the problem arguably worse. Just used a Set.
Re:A Bit Overcomplicated by AnIdiotOnTheNet on Thursday August 05, 2021 @10:36AM (#28074292)
It's not that they haven't come up in their job that's strange, but that they were never exposed to this level of base computing principle at any point in their career.
Re:A Bit Overcomplicated by thechao on Thursday August 05, 2021 @10:07AM (#28073912)
The right algorithm beats out low-level every time. Think of bitwise operators as a vector unit, but the scalar is a bit. That’s it.