I recently discovered that Java (and Scala) include non-short-circuiting logical operators &, |, and ^. I previously thought thes
Hmm. I know they can be incredibly useful for optimizing C/C++ code if used carefully. It might apply to Java as well.
The major use in C -- other than actual bit operations -- is to remove a pipeline stall. The short circuit operators require a branch operation. The bitwise operator will compute both sides and removes the chance for a mispredicted branch and the resulting stall.