6 Replies - 964 Views - Last Post: 07 June 2001 - 10:15 AM Rate Topic: -----

#1 objekt404  Icon User is offline

  • Whiskey Tango Foxtrot!?

Reputation: 0
  • View blog
  • Posts: 1,568
  • Joined: 15-April 01

Not just C, but . . .

Posted 03 June 2001 - 06:18 PM

ok, i've been codin' for a while now (since back when it was all programming (whats a script?)), anyway i have a school of thought question to put to you, the younger programmers.  

when needing to track the int value of a variable, should you increment or decrement?  back in the day, it was *always* increment.  just curious what ya'll think . . .

Is This A Good Question/Topic? 0
  • +

Replies To: Not just C, but . . .

#2 kalpeshmjoshi  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 25-April 01

Re: Not just C, but . . .

Posted 03 June 2001 - 09:02 PM

Not just inc or dec but always.  Whe asigne a value from long type or float/double type also.
[color=blue]
Was This Post Helpful? 0
  • +
  • -

#3 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4486
  • View blog
  • Posts: 28,399
  • Joined: 21-March 01

Re: Not just C, but . . .

Posted 04 June 2001 - 04:32 PM

what exactly do you mean?
Was This Post Helpful? 0
  • +
  • -

#4 objekt404  Icon User is offline

  • Whiskey Tango Foxtrot!?

Reputation: 0
  • View blog
  • Posts: 1,568
  • Joined: 15-April 01

Re: Not just C, but . . .

Posted 05 June 2001 - 06:11 PM

just curious.  i had always put the increment vs. decrement to personal choice, i was curious if there was *any* sound reason to do one or the other.
Was This Post Helpful? 0
  • +
  • -

#5 runtime error  Icon User is offline

  • Lucky.Code
  • member icon

Reputation: 3
  • View blog
  • Posts: 629
  • Joined: 19-March 01

Re: Not just C, but . . .

Posted 05 June 2001 - 10:50 PM

Well i always use increment you could decrement there really is no difference. The only reason i would decrement is if i was counting down to a blast or something.

or is that not the question posed.

Was This Post Helpful? 0
  • +
  • -

#6 objekt404  Icon User is offline

  • Whiskey Tango Foxtrot!?

Reputation: 0
  • View blog
  • Posts: 1,568
  • Joined: 15-April 01

Re: Not just C, but . . .

Posted 07 June 2001 - 07:41 AM

no, that is the 'right' answer runtime.  i mean, its as right as i could be.  

the entire backstory on this is my fiance & me got into a discussion on 'proper programming' (at one time she was going for comp. sci &, well, i'm from D.I.Y. University).

Was This Post Helpful? 0
  • +
  • -

#7 nighthawk  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 1,269
  • Joined: 11-April 01

Re: Not just C, but . . .

Posted 07 June 2001 - 10:15 AM

I would say the same thing that runtime did, increment unless you're counting down to something in which case you would decrement.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1