DEV Community

Discussion on: The Behavior of `i = i++` in Java

Collapse
 
renegadecoder94 profile image
Jeremy Grifski • Edited

I’m not sure any of the increment operations are natural. i = i + 1 isn’t valid in math, so there’s a bit of a hurdle there. That said, if you teach i++ in the context of loops, I wouldn’t be surprised if you saw students mixing the syntax anyway.

I’m not a huge fan of teaching syntax and algorithms. I’d rather students develop the critical thinking skills to solve problems on paper. Transferring their thoughts to syntax should be the easy part (but something that takes practice).