Slashdot Mirror


The Exact Cause of the Zune Meltdown

An anonymous reader writes "The Zune 30 failure became national news when it happened just three days ago. The source code for the bad driver leaked soon after, and now, someone has come up with a very detailed explanation for where the code was bad as well as a number of solutions to deal with it. From a coding/QA standpoint, one has to wonder how this bug was missed if the quality assurance team wasn't slacking off. Worse yet: this bug affects every Windows CE device carrying this driver."

1 of 465 comments (clear)

  1. Re:Regardless of whatever code in it is faulty by AuMatar · · Score: 1, Redundant

    Not really. Normally the code is structured like this:

    if(condition){
        goto cleanup;
    }
    do_something_that_is_only_valid_if_not_condition;
    if(condition2){
        goto cleanup;
    }
    do_something_that_requires_not_condition2; ...
    cleanup:
    do_cleanup;

    You *could* get it to work your way, with a lot of restructuring. You'd end up with 5 or 6 deep nested if statements though. You get to choose what way you think is least ugly. Generally, the goto is actually the best of several bad options. You're going to have something ugly, but the goto is fairly maintainable and makes the main body of code the least ugly it can be.

    --
    I still have more fans than freaks. WTF is wrong with you people?