Experience + Resourcefulness = Error-Less Code

Today a coworker asked me about a Warning that kept appearing in her website.  It said the header had already been sent so it can’t do what she was asking the code to do.  I had already seen this error before so I told her to remove and lines or spaces after the closing tag of any included file.

She looked at me like I had grown another head.  But she did what I told her to do and one of the warnings went away.  She was awed!  My co-programmer (who I take it was trying to help her also) asked me how I knew to do that and I told him I had encountered the error before and looked up how to fix it.  

Then he asked me how one figures out how to debug something like that as though my fix had no logical explanation.

I told him that the code was interpreting the space or line break character as a header and that’s why we had to remove it.  I also advised them to put the text of the error in a Google search and check the discussion boards that come up to find out how to debug it.  

That is why PHP is a dream to work with - it’s open source, there are communities out there sharing knowledge about bugs, errors they’ve encountered and general tips on getting applications to work.

The solution gave my coworker the courage to fix the other problem she encountered on her own.  It’s very liberating to be able to troubleshoot problems on your website by yourself so I’m glad I was able to help.

So remember, my friends - when you’re stumped try searching for the solution to your problems online especially if you’re working with open source code.