For example, I have an infinite while loop which keeps assigning true to our testBool:
boolean testBool;
while(true) {
testBool = true;
...more logic...
}
Are we wasting computation on reassigning the same value to our datatype, or are languages smart enough to recognize this inefficiency?
A smart compiler would pull it out of the loop.