A False Comparison

by in CodeSOD on

Iterating across a list is a very simple task. It's a CS-101 type thing, and if anything, it's the one thing I'd expect any developer to be able to do without confusing me too much.

Brendan has a co-worker that wants to change my mind about this.


Nothin Doin

by in Error'd on

IBM Profs was introduced in 1980 including both email and calendaring support. Online calendaring is now old enough to have grandchildren, but we still can't get the simplest things right.

As our friend Romeo rhetorically wonders "Million dollar question: What calendar does Microsoft use?"


Evaluating Selections

by in CodeSOD on

If you're writing an application with a drop-down list, it's typical and reasonable to auto-select a certain option in the list. But John found an approach to doing this that's anything but typical.

function selectsearch(myform, myselect, myinput) {
    var i = 0;
    var fvalue = 1;
    do {
        arrayresult = eval(myform+"."+myselect+".options["+i+"].value");
        if (arrayresult == myinput) {
            eval(myform+"."+myselect+".options["+i+"].selected = true");
            var fvalue=5;
        }
        i++; 
    } while(fvalue<3);
}

The Final Interview

by in Tales from the Interview on

Gennifer had a job. Her employer got bought out by another company, and the purchaser was notorious for gobbling up companies, taking over their processes, and then doing mass layoffs. Seeing the writing on the wall, Gennifer started job hunting.

Before too long, she had two very likely candidates. The first was Initrode. It wasn't a great match- Gennifer's skills didn't overlap well, and while the salary was respectable, it wasn't as good as the other position, at Initech.


Trying Parses

by in CodeSOD on

Another day, another terrible way to validate integers. Today's submission comes from Sluiper.

This approach, at least, contains a mild bit of cleverness. It's not the good kind of cleverness that makes a complicated problem more clear and easier to understand, but the bad kind that exploits assumptions about low-level technical details.


An Array of Colors

by in CodeSOD on

Sandra, still at InitAg, has to work with Brad. Some time ago, Brad was assigned a slew of front-end development tasks, since he's a web developer. But Brad isn't a front-end developer, and doesn't really have a good grasp of front-end development. Management isn't clear on the difference: "Aren't you a web developer? I don't care which end you use, just develop." Brad is also game to tackle whatever task is assigned to him, regardless of whether he has any sense of how to solve the problem.

When Brad needed to display data on a map, the requirements wanted the map layers to be distinguished by color. So Brad did the usual thing one might do in this situation: he created a gigantic array of all possible colors that might be used on the map. Actually, he created two: colors and colorsBlackWhite.


It Seats Zero

by in Error'd on

Automotive afficionado Mike S. proudly relates "My first and only car has been a classic 1965 6-cyl Ford Null. I've always loved it but it does crash from time to time, even though I've received many pointers on how to avoid that. I've considered getting an Infiniti and then would divide my time between the two." Avoid pointers, Mike.


Peer Feedback

by in CodeSOD on

Pieter-Jan needed to add some features to a PHP-based site for managing student assessments. Students would complete projects, submit them, and then receive feedback from their peers. The number of peers providing feedback is variable, so the application has to manage that. Which, you might be thinking, "that sounds like not a big deal to manage," but for Pieter-Jan's predecessor, it seems like it may have been.

    if($i > '0') {
        $team=array($studentName1,$content1,$motivation1,$isTeamMate1);
    }
    if($i > '1') {
        $team=array($studentName1,$content1,$motivation1,$isTeamMate1,$studentName2,$content2,$motivation2,$isTeamMate2);
    }   
    if($i > '2') {
        $team=array($studentName1,$content1,$motivation1,$isTeamMate1,$studentName2,$content2,$motivation2,$isTeamMate2,$studentName3,$content3,$motivation3,$isTeamMate3);
    }

Archives