Sudarshan
12/19/2025, 7:42 PMi++
2. i += 1
Reason I’m asking: Swift does not have increment or decrement operators like Kotlin and other languages. When I posted about this on social media, I got comments saying using the increment operator is confusing, which doesn’t make sense to me. What’s your opinion on this?Kirill Grouchnikov
12/19/2025, 7:47 PMKirill Grouchnikov
12/19/2025, 7:48 PMPHondogo
12/19/2025, 7:48 PMJoffrey
12/19/2025, 7:51 PMi++ should I need to, but I almost never need it in the first place.Chrimaeon
12/19/2025, 8:31 PMChrimaeon
12/19/2025, 8:32 PMSudarshan
12/20/2025, 2:49 AMSudarshan
12/20/2025, 2:54 AMEl Anthony
12/20/2025, 4:00 PMYuri Geronimus
12/21/2025, 6:30 AMi += 1 because it’s universally readable-engineers from any background immediately understand it. It also avoids the classic C/C++ thoughts about whether ++i or i++ (and the side effects that sometimes come with that discussion).
In general, we should reduce cognitive load in code reviews and maintenance. So we prefer i += 1 when the code is meant to be read clearly and consistently.loke
12/21/2025, 2:58 PM++ .loke
12/23/2025, 4:56 AMloke
12/23/2025, 4:57 AM