NYCPHP Meetup

NYPHP.org

[nycphp-talk] Development methodology WAS: why does setcookie fail?????

Hans Zaunere hans at nyphp.org
Mon Sep 8 11:23:06 EDT 2003



Chris Shiflett wrote:

> --- Adam Maccabee Trachtenberg <adam at trachtenberg.com> wrote:
> 
>>But seriously, my suggestion is whenever you're getting frustrated
>>to take a deep breath, a five minute break, then come back and put
>>together a step-by-step list of what you're trying to
>>accomplish. Once you're armed with a list, you can then verify that
>>each step is getting the correct input and providing the correct
>>output. Often times, merely the process of figuring this out will
>>trigger what you should do to fix the bug.
> 
> 
> This is great advice. The setcookie line of questioning perfectly illustrates
> why erroneous assumptions can make simple problems into very complex ones.
> 
> For example, consider this calculation:
> 
> (25 * 4) * 10
> 
> There are basically three pieces of data here that are combined together in two
> operations to produce the final output. Now, consider this question:
> 
> Does anyone know WHY I can multiply 100 by 10 and get 1250??? See if you can
> explain THAT one!!!
> 
> After scores of messages back and forth, it is realized that the error was that
> the following calculation was actually being performed:
> 
> (25 * 5) * 10
> 
> So, if the question asked had been why 5 was being returned by something
> instead of 4, the answer would have been much easier (and less misleading).
> 
> Breaking things down is essential to solving problems. This should have been
> the first test to prove the assumption wrong:
> 
> 100 * 10
> 
> This would have given 1000, not 1250, so the erroneous assumption should never
> even be mentioned in the question. A little effort up front can save a lot of
> time for everyone.
> 
> Hope that helps.

This is great stuff.  Let's get something like this formalized and added into the Fundamentals website, alongside the Ten Commandments.  Website development is unqiue, in that there are several very seperate, yet equally vital, parts of the equation (for example, browser interaction, DB interaction, and application logic).  If any of these are broken, the whole system breaks, yet it can be difficult to know where the problem stems from.

H




More information about the talk mailing list