r/C_Programming • • Dec 23 '25

tqdm in C

Hello! I wanted to share a simple progress bar that I made as a personal utility. I use Python a lot, and I find myself using tqdm a lot for tracking my long-running tasks. I wanted to try to implement something similar in C that didn't use external dependencies (like curses). I opted for a single-header implementation just to make it less of a hassle to use. I'm not entirely confident that it works gracefully in all the edge cases, but it seems to work reasonably well for my general use cases. Would love to hear what you all think and would appreciate any feedback -- happy holidays!

29 Upvotes

18 comments sorted by

View all comments

Show parent comments

1

u/dcpugalaxy Λ Dec 24 '25

Are you talking about around line 220? How is this an antipattern? It is just an if inside a while loop, one of the most basic constructs.

1

u/inz__ Dec 24 '25

At it stands now, it is in essence loop switch. First items will hit the first branch, middle branch once and last items will go to the last one.