Ayende @ Rahien

Unnatural acts on source code

Bug hunting, looking around the box

I just spent way too long trying to figure out what is wrong with this code:

<script type="text4/javascript">

        function customerUpdated()

        {

            //dostuff

        }
</script>
<
asp:DropDown ID="Customers" runat="server" DataTextField="Name"   
       OnClientChanged="customerUpdated();" DataValueField="Id"/>

The answer is below... but do try to figure it out

.

.

.

.

.

.

.

.

Can you see the problem? Perhaps this will help:

<script type="text4/javascript">

Argh!!! I must have gone over it a hundred times and didn't see it.

Comments

daniel
06/12/2007 02:52 PM by
daniel

that's dynamic languages ...

can't live with them , can't without...

Edward
06/12/2007 03:28 PM by
Edward

Spotted it immediately, but kept looking deeper for a real bug assuming that was just a typo in your blog post.

josh
06/12/2007 03:58 PM by
josh

Saw it right away. That sort of thing happens to me all the time though.

Herr Ziffer
06/12/2007 07:26 PM by
Herr Ziffer

I think these are the kinds of problems pair programming is supposed to solve.

Pierre Henri
06/13/2007 09:06 AM by
Pierre Henri

I did like Edward.

Note that it is easier to spot other people's error than our own. The reason is that, when you read your own code, you know what is written, therefore you only look at the important stuff.

Simone Busoli
06/13/2007 12:39 PM by
Simone Busoli

Agree with Pierre... but maybe you're spending too many hours on the pc ;)

Glenn Block
06/14/2007 06:13 AM by
Glenn Block

Spotted it immediately, but it's easy when it's not your code, nor is your neck on the line for getting it to work. Actually it popped out so quickly I thought I must be wrong and that maybe text4/javascript was valid syntax and I was in the dark.

Comments have been closed on this topic.