Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I’ve found significant code in c/c++ where bitwise operations are done for things like division etc by shifting a certain way.

Oh, yes. I used to do that sort of thing frequently because the time savings was significant enough. As you say, though, compilers have improved a great deal since then, so it's not generally needed anymore.

If stupid bit tricks like that aren't necessary, they shouldn't be used. They do bring a readability/mental load cost with them.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: