u/theNakedNecromancer - 2 Archived Voat Posts in v/programming
u/theNakedNecromancer
  • home
  • search

u/theNakedNecromancer

0 posts · 2 comments · 2 total

Active in: v/programming (2)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: Serious question: why would anyone use spaces?

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.

0 02 Oct 2019 05:11 u/theNakedNecromancer in v/programming
Comment 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?

0 09 Jun 2018 23:44 u/theNakedNecromancer in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.