Jump to content


Photo

CHALLENGE: thought efficiency


  • Please log in to reply
No replies to this topic

#1 bcrscahh198987

bcrscahh198987

    Mack Daddy 31337

  • Members
  • 211 posts
  • Location:Ur rektumm

Posted 27 November 2009 - 02:20 PM

So.... I'm noob, so I'll use simple stuff.

By the way, I'm using the ruby programming language



a = 1

a = a+1


now what I did was to add the value of 1 to the variable "a", then a would be equal to a+1. So a = 2 or a = a+1


a = 1
a += 1

This is much more efficient than a = a+1, and less confusing. Sometimes the a = a+1 seems to be a paradox.

Anybody got examples of programming efficiency that a noob like me can understand?




BinRev is hosted by the great people at Lunarpages!