Another Programmers Are Human Moment

I wrote a PHP script that takes the details of an HL7 interface stored as XML and presents it in a nice neat HTML table.

The formatting is customized so most XML to HTML table tools won’t work for this.

As I parse the details out of the XML structure, I write them to the string $output.

I had everything working except for the parameters.

I gather the parameters by storing the XQuery paths into an array and iterate through that adding the details to the html table.

That bit wasn’t working.

I added some code to ensure that I was stepping through the array, and that the information was correct.

It took me about 20 minutes to see it….can you see the problem?


$output .= '<tr class="mdiparms">';

foreach($nxqArr as $nxq) {
         $ouput .= '<td>'.getNodeValue($nxq).'</td>';
}

$outout .= '</tr></table>';

Definitely an end of the day /facepalm moment!

Advertisements

The Real Reason Why Many Programmers Don’t Have Social Lives

I often have difficulty speaking to other humans.

After hours buried in code,  when I’m forced to communicate with other humans I have difficulty in switching to the rather arbitrary syntax and structure of Conversation.

Many people believe this is why I don’t have much of a social life,  but that isn’t the real reason.   Like most full-stack programmers I only need a few minutes to get comfortable with the current language/platform.

Here’s what happens to many of us when we’re planning on going out…

As we’re leaving we realize we left something important, like our phone, keys etc near our computer.

When we approach the computer,  we think about something we’re working on,  or we remember that we wanted to try something,  or had an idea to fix a problem…

So we think:

I’ll just take a minute and try that…

What follows are thoughts like

Well, that didn’t work!  Maybe if I….

and

now where was that chunk of code I used before??

then, finally..

Wait, why am I hungry?

and/or

OMG, Why is it so dark out??!!!

Then when you look out and see that its not an alien invasion with ships so big they blot out the sun, but rather that its late at night and life has once again passed you by.