edg: (You and your "Facts" and your "Physics")
[personal profile] edg
Thoughts on a Monday night.

  • It's been too long since I went to a movie.
  • It's been too long since I had anyone to go to a movie with.
  • Bushmills apparently triggers the bitter receptors on my tongue, since Diet Coke tastes like candy immediately after a sip of Bushmills.
  • Maybe it's sour. Not my field of study.
  • You can tell it's a slow night when my main object of inquiry is "does the distinction between pre-increment (++i) and post-increment (i++) matter anywhere except during assignments and function calls?".

Date: 2004-09-20 08:48 pm (UTC)
From: [identity profile] ophia921.livejournal.com
i'd go to a movie with you :)

Date: 2004-09-21 12:13 am (UTC)
From: [identity profile] gehn.livejournal.com
Conceptually, if you're saying nothing but "increment i", then they're the same.

However, under the hood, there's one big difference when you're worried about memory, especially when using the ++/-- operators with bigger types than ints:

Since the postfix version returns the value of i, *then* increments, it actually returns a copy of i, then increments i, so that the expression will still get the old value of i. When you use the prefix, the new value is being returned, so everything just happens *to i* in place.

Not a huge deal unless you're worried about memory, or you implement ++ or -- for a particlaryly large class/struct, and aren't thinking about behind-the-scenes copying.

Other than that, it's all really which value of i you want. :)

Date: 2004-09-21 05:51 am (UTC)
From: [identity profile] telerib.livejournal.com
For some reason, I really wanted to parse the title as Peccari (I have been a peccary).

Must find coffee now.

December 2015

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27 28293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 9th, 2025 05:26 am
Powered by Dreamwidth Studios