4 ms·
It simply hasn't come up. I've written accounting and billing software that processes millions without using bit shifting, logistics solvers that do multithread
by sudhirj 5y ago
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.
- thechao 5y agoThe 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.
- AnIdiotOnTheNet 5y agoIt'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.
- hnick 5y agoWould 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.
- sudhirj 5y agoI 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.