Stop Using i++ in Your Loops

Why ++i is often better than i++ (pre-increment vs. post-increment)

Devin Soni
Better Programming
Published in
2 min readNov 6, 2019

--

Photo by Safar Safarov on Unsplash

Introduction

If you’ve written a for-loop before, then you have almost definitely used i++ before to increment your loop variable.

However, have you ever thought about why you choose to do it like that?

--

--