Hacker News new | past | comments | ask | show | jobs | submit login

Most disappointing was the fact that the top comment focused on x=x/2 vs x/=2, the latter of which I believe is more confusing than not. In any event, none of the three options ought to make a difference when you have the luxury of a compiler, which can choose the "best" way to do it.

When you're programming a microcontroller YOU are often the compiler and therefore need to know the relative clock times for each command. I remember one chip where the division command could take 100 cycles while a shift was 2. Big difference there, and you'd definitely pick the shift.

One of the later comments there focused on actually decompiling the resulting code. I was surprised that the compiler did not produce the same output.




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

Search: