Re:Backdoor in upstream xz/liblzma leading to SSH server com...
by jononor on Saturday March 30, 2024 @07:54PM
(#39879850)
Those Python snippets are both clean options :)
Bitwise is highly context dependent. There are simple usages like shifts to divide/multiply by 2. Idiomatic patterns that are clean when wrapped in good reusable and restricted macros, like for common registers manipulation in microcontrollers. And other uses that are anything from involuntary obfuscation to competition grade obfuscation.
Re:Backdoor in upstream xz/liblzma leading to SSH server com...
by throwaway7356 on Sunday March 31, 2024 @12:59AM
(#39881572)
> There are simple usages like shifts to divide/multiply by 2.
Clean code should not do that as the compiler will do that.
Clean code should just say what it wants to do, not replace that with low-level performance optimizations. (Also wasn't performance to be obtained from newer hardware?)
Re:Backdoor in upstream xz/liblzma leading to SSH server com...
by jononor on Monday April 01, 2024 @12:39PM
(#39896047)
Fair point about shifting being superfluous and not clean!
I never said performance should come only from newer hardware. Only that it is possible to trade vs hardware/costs - unlike correctness and trust.
Another favorite of mine is bitshifting / bitwise operators. Clear and obvious? Depends on your background. Fast as hell? Yes, always. It isn’t always needed, but when it is, it will blow anything else out of the water.