// you’re reading...


(not) Cargo cult programming, source control, communication, and lack of it all

Sometimes group projects go wrong. Terribly, terribly wrong. Consider a multi-group project with a shared code-base, for a car racing game. Coded in C.

Chat with Dan on his group project ruined by incompetent members

“This is even worse than before. They put multiple versions of their same code, in the same branch. And demos they found online.”

Cargo cult programming is a style of computer programming that is characterized by the ritual inclusion of code or program structures that serve no real purpose.

I have seen some students try to paste in blocks of code, seemingly at random, out of desperation, frustration, confusion… though doing that in a completely different language is new. Epic fail!

The thousand monkeys on thousand typewriters mentality fails as the number of monkeys approaches one. Software rarely gets better from having more code thrown in (actually it often gets worse). And lack of thought poisons the code-base for all of the team members, with content that should simply be deleted. This quickly turns into a mess of a project.

We’ve got to get more monkeys!

So for everybody’s sanity (and better grades!), lets refrain from throwing random code into group projects. I think a good rule to have is a requirement for some comments (it’s ok if they are short), both next to the new code, and in the source control commit messages. If anything, then simply as a proof, to everybody, that you know what you are doing. Lets be honest, if one isn’t sure what’s happening with their own code, others will have even less of an idea trying to figure it out.

Read more

Uhh... nothing else appears to be relevant enough.


  1. Posted by Dan | March 20, 2008, 1:11 am

    Well some good news is that we have manged to get everything in C and amazingly the svn set up right. However it took a lot of arguing and hitting my head on the wall, table, what ever was in range.

    Tho unforntely a lot of the members of the team are still working under the method of starting with some random demo or example online and just throwing lines of code in in till it works. This is leading to an extermaly messy and hard to work with code base and almost random results at times and the oringal programmer of the bugged code having little or no idea how to fix it as they do not relay understand how it works them self.

    Things are getting better as the ones of us involved in the project who have more experience have been keeping on the rest to use better partices and are working with them more closely.

    Personally i blive a big part of the problem is that university do not teach some of the fundamentals that are needed in real life projects, like how to use and set up an svn server, or how to code in a large project that is broken in to several sub teams or even how to do good tests on your code before you check it in. Also the Cargo Cult Programming method is never fully weeded out as students can just get by, by using it for small sized assignments where the problems are minimal but can not translate to big projects or working in teams.

    Another issues is the arogence that seems to come with being in a tehcnial field. A lot of us think we are right about our methods or solution even if we have no proof or valid source for this blife. This can lead to cirucalr arugments and the use of tools and methods that can over complicated the project well adding nothing but bugs and complications.

    I would like to add that not every one in this project i am yelling about in the artical are idiots and they are all good guys with the best of intentions but could do with a bit more experience in groups (including my self). The comments where made in a very emotional state when the project looked it was head to ceritent failure and no one was realy talking to each other. Now the project is getting back on track and using better methods, in the end it was a good learning experience for us all (i hope).

    Reply to comment

  2. Posted by Aziz | March 20, 2008, 7:45 am

    “Fuck, fuck fuck fuck fuck” about sums up a programmer’s thoughts much too often, Dan :P

    Reply to comment

  3. Posted by Noam | March 20, 2008, 10:07 am

    “…though doing that in a completely different language is new…”
    Just for fun, I’m going to put random sections of COBOL into my next group project and see how people react. :)

    Reply to comment

  4. Posted by Noam | March 20, 2008, 3:15 pm

    If at all possible, make sure your code compiles before you commit. I’ve avoided a lot of trouble by enforcing that rule. Breaks can still happen, of course, but not as often (unless everyone is working on the exact same piece of code and merging multiple changes there… and if that’s happening *often*, you’ve got other problems :) )

    Reply to comment

  5. Posted by Tony | March 20, 2008, 8:26 pm

    Noam, we’ve got to take some classes together. I figure that instead of Java, I can write my code in jRuby, and then splice the bytecode into the project ;)

    Also, compilation is a weak test, but checking in code that doesn’t as much as compile is simply negligent.

    Reply to comment

  6. Posted by Noam | March 24, 2008, 9:38 am

    I do agree it’s a weak test, but it’s the bare minimum. Ideally, you should definitely make sure it also runs, then do testing of the area you changed to make sure nothing was compromised, and THEN have your buddies do a code review. Some places will enforce unit test passes before committing.
    But schoolwork is another story, in that the projects are small and time is volatile. Things can come up that don’t really allow for a strict routine. If you have another assignment to do and you want me to take on your code for a day, then at least don’t put me through a million compile errors. That way, I won’t mind dealing with your new segfault nearly as much. ;)

    Reply to comment

  7. Posted by Gorge | March 28, 2008, 1:47 am

    Sounds like a freaking nightmare Noam. lol Funny read though. Dan;s last line was the classic of course. :O)

    Btw, I have found every programmer to be very arrogant about his skills.

    Reply to comment

  8. Posted by Geekhall.net Admin | April 20, 2008, 1:26 pm

    Well, as usuall – keeping all files clean and up to date with everyone is hard, tha’s why, when we sit to any projects we do not start until everyone have a Beyond compare application and all files are the same :)

    Reply to comment

  9. Posted by Tony | April 20, 2008, 2:10 pm

    Or, you use an actual source control system (such as Subversion) to keep everybody’s files in sync and up to date. It also keeps track of all the changes, so you know who changed what, and can roll back to previous versions if things get horribly broken.

    Reply to comment

Post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>