View Single Post
  #1   Spotlight this post!  
Unread 12-05-2010, 22:12
Chris27's Avatar
Chris27 Chris27 is offline
Registered User
AKA: Chris Freeman
FRC #1625 (Winnovation)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Mountain View
Posts: 196
Chris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant future
Re: Collaborations and Alliances

As a CS student at CMU, I've always been told that

Code:
if(isSomeCondition == true) { ... }
is horrible style, and this really should be written as
Code:
if(isSomeCondition) { ... }
Code:
if(isSomeCondition = true)
Is "correct" syntax and by itself will not cause a run time error. However this will cause your program to behave incorrectly (for instance the if statement will always evaluate to true) which could definitely lead to a run time error if e.g.

Code:
if(somePtr = NULL) { ... }
else { 
  somePtr->someField = someValue;
}
I assume this is what you meant apalrd?
Reply With Quote