I don't think VB produces unpredictable results. That the return value of a function depends on the data passed to it isn't strange at all. Lots of function in lots of languages do so!

I have to say I think Ovid's example is a good one. I recently had to debug a bit of VB code that was giving unpredictable results - It was supposed to check the date of a remote file and update the local file if it was out of date. This worked most of the time, but some users in some locations reported that they sometimes could not see updates at the beginning of the month.

It turned out that one of the dates was using the machine locale and the other was using the US date format. Now this is a bug and clearly should not work if you are on a european locale. But VB in its infinite wisdom was not raising an error or even reporting a warning when given a US date of 13/5/2001 - it just tried out all the other date formats in the locales table until it worked!

This is unpredictable because it depended on when the remote file was updated, when the local user last got a copy of it, whether they noticed it was out of date and whether it is currently the end of the month. This is not DWIM! A bug like this needs to be known about ASAP, not a year down the line (I wasn't the first to look for the cause of the bug!)

The difference between a feature like this and Perl's undocumented DWIMs is the intelligence of the designer: the VB feature was never thought through: the code doesn't change but as you go through the month whether it is right or wrong does change.

-- iakobski


In reply to Re: Re: Microsoft vs. Perl and sloppy programming - Wildly OT by iakobski
in thread Microsoft vs. Perl and sloppy programming - Wildly OT by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.