View Single Post

  #12 (permalink)  
Old 02-27-2008
Rik Wasmus
 
Posts: n/a
Default Re: If statement trouble

On Wed, 27 Feb 2008 00:06:43 +0100, The Natural Philosopher <a@b.c> wrote:

> Tony wrote:
>> Jerry Stuckle wrote:
>>> AceX wrote:
>>>>
>>>> Thank you all. I don't know if anyone else has this problem, but
>>>> sometimes I just have brain lapses. I appreciate all the help guys
>>>> (and gals?)
>>>>
>>>
>>> Ace,
>>>
>>> I don't know how many times I've done that - stretching all the way
>>> back to the mid 80's when I was writing C code :-)
>>>
>>> Also C++, Java, PHP...
>>>
>>> It's also a common error in many of my classes - students will look
>>> and look at the code and don't see what the problem is. When I point
>>> it out in about 2 seconds, they feel embarrassed - until I tell them I
>>> spotted it so quickly just because I HAVE made that mistake so many
>>> times. :-)

>> I don't know how often I've simply asked someone to take a look at
>> some code - because sometimes you get too close to the code, and you
>> just don't see those sort of simple errors. Someone else's fresh
>> perspective is all it takes.

> I spent nearly half an hour beating my brains out till I realised the
> variable I was comparing had a subtle spelling error.
>
> In C you get an undeclared variable type error..not (necessarily) in
> PHP..


.... which is why you should control the error_reporting level in a
development environment.
--
Rik Wasmus
Reply With Quote