If statement trouble

This is a discussion on If statement trouble within the PHP Language forums, part of the PHP Programming Forums category; Tony wrote: > Jerry Stuckle wrote: >> AceX wrote: >>> >>> Thank you all. I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-26-2008
The Natural Philosopher
 
Posts: n/a
Default Re: If statement trouble

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..
Reply With Quote
  #12 (permalink)  
Old 02-26-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
  #13 (permalink)  
Old 02-26-2008
Rik Wasmus
 
Posts: n/a
Default Re: If statement trouble

On Tue, 26 Feb 2008 19:16:11 +0100, Tony <nospam@example.com> 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.


Hehe, the numner of times way back when I started out to ask this group
something, tried to boil it down to it's essentials, and the answer
allready became clear to me. Asking oneself how to ask another efficiently
for help with a particular problem often yields the result without having
to actually ask :). It's kept the number of embarrassments quite low,
spending a good half hour on a question, and then just discarding it :).

Offcourse, the mistake in this case is one we all make/made, and less
easily spotted with aforementioned method.
--
Rik Wasmus
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:29 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0