Another subtle bug

Ovid on 2003-10-23T23:53:18

The following bug really irritated me when I found it. It's found repeatedly throughout our test suite because someone appeared to be cutting and pasting code.

assert_lists_eq(
    [ map { $_->title_no } sort { $a->title_no < $b->title_no } $mf->titles ],
    [ $matrix->title_no, $spider->title_no ]
);

Now what I want to know is why this passed under 5.6.1? (Hint: if you don't see the bug right away, consider that the test is failing because the elements in the first array ref are getting returned in the wrong order).


Stopping pasters in their tracks.

dws on 2003-10-24T01:19:57

After a meeting of the Silicon Valley Patterns group this week, we stood around speculating about how hard it would be to rig Eclipse (an open source editor that's big in the Java world) to ring a buzzer whenever someone copied a large block of code from one file, and pasted it into another. Or to trigger a webcam, to record the offender's picture for the copy-and-paste hall of shame. Or to count the number of times a cut or copy got pasted, and send off an email to the QA folks, warning them of where to look.

Re:Stopping pasters in their tracks.

Ovid on 2003-10-24T03:34:59

I'm drooling for this already. When Perl6 comes out, I expect that we'll be able to have rich IDEs like so many other languages. Then we can implement this for ourselves. And maybe have the editor automatically shut down if use strict isn't the second line typed or if taint checking isn't used in a program when "use CGI" is present or ... :)