Log in

No account? Create an account
blimey - oldbloke's mutterings — LiveJournal
March 9th, 2011
11:58 pm
[User Picture]


Previous Entry Share Next Entry
There are some Baaaaaaaad coders out there. I mean, I know I'm not good (I've had people laugh at some of my stuff, to my face, and had to admit they were justified), but, well.
I Googled around for a cardgame in Python source, thought I might save myself some learning time by nicking the basic setting-up-the-window and moving-cards-around stuff.
This guy's code is scary bad, quite apart from the fact it's supposedly an AI project but plays the game of Hearts unbelievably poorly.
Got to run the same checks for all 4 of the players? Let's just have all that code in 4 times, coz you didn't paramaterise the player identifier.
There's a huge chunk of "is this card legal here?" that appears twice for no discernible reason. And it has the checks in the wrong order...
OK it's clear English is not his first language, but I don't think that should affect coding ability, really.
I don't think any of it is nickable, it's too bad.

(4 comments | Leave a comment)

[User Picture]
Date:March 10th, 2011 07:41 am (UTC)
Quite a lot of them come from my institution - the mention of its being an AI project scares me because that multiplies the probability that it's one of ours manyfold... We have a Plan to fix it though :-)
[User Picture]
Date:March 10th, 2011 07:58 am (UTC)
Not unless you have a very long commute:
#I wrote this Game for course Artificial Intelligent in Yazd Jahad University
[User Picture]
Date:March 10th, 2011 08:04 am (UTC)
[User Picture]
Date:March 10th, 2011 01:30 pm (UTC)
I'm giving a lecture on microcontroller programming on Monday, as a stand-in. The lecture notes I was sent (by the person who has been doing the course since MS-DOS was a modern operating system rather than an embarrassment) contains several lines like this:
#define InputPort = 0x378;

I spent yesterday afternoon in the lab writing programs that actually work, and pasting the things into my presentation. Along with a slide showing how putting equals signs and semicolons into preprocessor directives will bugger up your code.

I also spent some time yesterday interviewing a self-styled programming wizard who couldn't understand how two other students had managed to submit code substantially identical to his work of genius. He also couldn't understand what was wrong with this:
     char P[3];
     sprintf(P,"Vector A");
My Website Powered by LiveJournal.com