Comment on: Serious question: why would anyone use spaces?
0 02 Oct 2019 05:11 u/theNakedNecromancer in v/programmingComment on: C/C++ inc/decrement operator style
As long as you're not screwing with the way C performs the action, I don't see why not. In other words: x++ and ++x are two completely different functions.
So, doing x *= ++i will perform:
x = x * (i + 1)
But, doing x *= i++ will act like:
x = (x * i) + 1
Beyond that, style is up to you. Most C-coders (and style guides) won't want whitespace around the variable, or between a variable and increment operator. But, if it's code just for you, who cares?
I can set VIM (and most any other editor worth its salt) to "replace" a tab with a certain number of spaces.
I can't set ANY editor to logically replace 4 spaces with a tab.
When working on code with a group, it's best to default to spaces. This way tab-people can set their editors to replace with spaces, and space people can just do their thing. You CAN'T do that in the opposite direction.