I see Sun Certified programmer & developer for java 2 write this: Do not use assert expressions that can cause side effects! but I can't understand its meaning. Can someone explain it more detail?
My Way,My Pace
posted 12 years ago
I believe the intent is to not build logic based on the assert statement that would not be available when the compile is done turning off assertions. One example I can think of is to base some logic that wraps an assert statement in an if statement. Bottom line, the assert should be used for debugging purposes, not to control logic.