Results 1 to 11 of 11

Thread: Rant: document your code people !

  1. #1
    zombologist Senior Member doc_bean's Avatar
    Join Date
    Oct 2004
    Location
    Riding Shai-Hulud
    Posts
    5,346

    Default Rant: document your code people !



    I have to use some sort of 'middleware' software in order to implement some filters, the nice people who have written the code have decided in all their wisdom to not document in the cpp files at all and only give the shortest of API documentation, which isn't nearly enough to figure out how everything works, especially considering the amount of overloading being done

    So i've been wasting the last week and a half trying to figure out how to implement my code with theirs and i'm still no further.

    The funniest part is, they've released the code as open source so everyone can use it. Good (!'§!çà luck people !
    Yes, Iraq is peaceful. Go to sleep now. - Adrian II

  2. #2

    Default Re: Rant: document your code people !

    Ah, welcome to the wonders of other people's code!
    It's always like that, doc_bean. It's always tricky to use other people's code, because it takes a long time till you can start doing anything with it - very steep learning curve. I'm sorry to say this, but you should try to get used to it. If you ever find nice code, well written, good documentation - consider yourself lucky, because those will be the exceptions.
    Therapy helps, but screaming obscenities is cheaper.

  3. #3
    Amphibious Trebuchet Salesman Member Whacker's Avatar
    Join Date
    Nov 2006
    Location
    in ur city killin ur militias
    Posts
    2,934

    Default Re: Rant: document your code people !

    // includes for headers
    #include "extreme anger.h"

    // add angry faces here to set mood for post

    Quote Originally Posted by doc_bean
    // begin rant loop on morons who wrote code that I am trying to fix
    // and didn't document it so it just makes my job that much harder

    Quote Originally Posted by doc_bean
    I have to use some sort of 'middleware' software in order to implement some filters, the nice people who have written the code have decided in all their wisdom to not document in the cpp files at all and only give the shortest of API documentation, which isn't nearly enough to figure out how everything works,
    // add evidence that previous coders probably had no idea what the
    // @#$#@$3 they were doing

    Quote Originally Posted by doc_bean
    especially considering the amount of overloading being done

    // more angry faces to emphasize anger @ said stupidity

    Quote Originally Posted by doc_bean
    // relate sheer futility and time wasted on said effort, possibly add
    // ideas on how to extract revenge on individuals using A. vat of crisco
    // and B. jumbo sized thermos.

    Quote Originally Posted by doc_bean
    So i've been wasting the last week and a half trying to figure out how to implement my code with theirs and i'm still no further.

    // finish up with closing statements

    Quote Originally Posted by doc_bean
    The funniest part is, they've released the code as open source so everyone can use it. Good (!'§!çà luck people !
    // final angry faces to top it off
    Quote Originally Posted by doc_bean

    "Justice is the firm and continuous desire to render to everyone
    that which is his due."
    - Justinian I

  4. #4
    zombologist Senior Member doc_bean's Avatar
    Join Date
    Oct 2004
    Location
    Riding Shai-Hulud
    Posts
    5,346

    Default Re: Rant: document your code people !



    Priceless Whacker !

    Blodrast: I've been in this situation before? I just needed to vent a little, if the api is illegible and contains smileys, it's time to take a little break...
    Yes, Iraq is peaceful. Go to sleep now. - Adrian II

  5. #5

    Default Re: Rant: document your code people !

    Quote Originally Posted by Whacker
    //lots of nicely commented code
    Now that's the way to properly document code!

    doc_bean: I'm sure you have, and I'm sure you will be again, mate. Nothing wrong with venting.
    Also, if you wanna look for the silver lining, I can clearly remember a situation where I was using some code that I wasn't sure what was supposed to do exactly... and it had some comments (not much, but I thought, hey, better than nothing)... it was all a bit complicated, not trivial, obvious code. So I went by the comments, but the stuff wasn't working as it was supposed to.
    After looking, and looking, several days wasted, I figured out what the problem was. The problem was that the authors of the code did not have English as their primary language, so what they probably meant to write was the actual opposite of what they had written... In other words, the comments were blatantly wrong...

    Morale of this story: sometimes, no comments is better!
    Therapy helps, but screaming obscenities is cheaper.

  6. #6
    Member Member Alexander the Pretty Good's Avatar
    Join Date
    Jun 2004
    Location
    New Jersey, USA
    Posts
    4,979

    Default Re: Rant: document your code people !

    lol, Whacker. That's great!

    My sympathies, Doc. It's a practice I should get into more, although I'm not writing anything really complicated for my courses...

  7. #7
    Simulation Monkey Member The_Mark's Avatar
    Join Date
    Dec 2004
    Location
    Helsinki, Finland
    Posts
    2,613

    Default Re: Rant: document your code people !

    Ho, you should've seen the old EBBS. 100k lines with nary a comment.

  8. #8
    Moderator Moderator Gregoshi's Avatar
    Join Date
    Oct 2000
    Location
    Central Pennsylvania, USA
    Posts
    12,980

    Default Re: Rant: document your code people !

    Documentation is boring. Besides, everyone knows their own code is so intuitive that any documentation or comments is redundant. The phrase back when I was a programmer was "The code is self-documenting."

    Good luck doc.

    Whacker, your post is a thing of beauty.
    Last edited by Gregoshi; 04-05-2007 at 20:04.
    This space intentionally left blank

  9. #9
    Poll Smoker Senior Member CountArach's Avatar
    Join Date
    Aug 2006
    Location
    Sydney, Australia
    Posts
    9,029

    Default Re: Rant: document your code people !

    Well I remember last year when I was doing my final course in Software Development. We had a 3D Tic-Tac-Toe game going. I was trying to figure out the basis of the code. We were using the x, y, z axis. But for some reason the moron who did the code made it z, x, y or something. It was so infuriating to read it, because I had no idea what was going on.

    And lol Whacker, that was a great post.
    Rest in Peace TosaInu, the Org will be your legacy
    Quote Originally Posted by Leon Blum - For All Mankind
    Nothing established by violence and maintained by force, nothing that degrades humanity and is based on contempt for human personality, can endure.

  10. #10
    Amphibious Trebuchet Salesman Member Whacker's Avatar
    Join Date
    Nov 2006
    Location
    in ur city killin ur militias
    Posts
    2,934

    Default Re: Rant: document your code people !



    I'm glad you enjoyed that my friends.

    I'm inclined to agree with Gregoshi though. Have been re-teaching myself C/C++ over the past few weeks, and it's been some hard going. It's pretty much impossible for me to sometimes comment my code because I haven't a damn clue what exactly it's doing or how I made it work!!


    "Justice is the firm and continuous desire to render to everyone
    that which is his due."
    - Justinian I

  11. #11
    Pinko Member _Martyr_'s Avatar
    Join Date
    Dec 2002
    Location
    Dublin, Ireland
    Posts
    2,882

    Default Re: Rant: document your code people !

    C++ can be very tricky to read, no doubt about it! But in my experience Perl is about 10^100 times worse! Seriously, forget trying to figure other peoples' code out, when code you've written yourself a few months back WITH good commenting is nigh on impossible to maintain!
    Eppur si muove







Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO