r/learnpython • • May 06 '21

What are some programming tools that every beginner programmer should know about?

Example, today I learned about Git and GitHub and it felt incredible.

480 Upvotes

190 comments sorted by

View all comments

Show parent comments

6

u/BenjaminGeiger benjamingeiger May 06 '21

Try fprintf(stderr, ...) instead.

stdout tends to have output buffering enabled, so if the code crashes before the buffer gets flushed, then the contents of the buffer can be lost. stderr gets dumped to console immediately.

2

u/O_X_E_Y May 06 '21

Hmm interesting, I'm very much a beginner there still and not familiar with all the intrinsics, so things like this definitely help!

2

u/BenjaminGeiger benjamingeiger May 06 '21

In fairness, I haven't really used C much since early grad school. I just remember running into that precise issue.