Code Review? Looking for some thoughts on OOP C Code

This is a discussion on Code Review? Looking for some thoughts on OOP C Code within the C Programming forums, part of the General Programming Boards category; I'm wondering if anyone would be so kind as to read some code I wrote, and provide feedback about things ...

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    35

    Code Review? Looking for some thoughts on OOP C Code

    I'm wondering if anyone would be so kind as to read some code I wrote, and provide feedback about things I may have done wrong. Maybe performance considerations? Things like that. And I'm wondering if anyone has implemented C libraries like this.

    I've been writing some code that started as me experimenting with C, and ended up being quite useful. I haven't added thread safety yet, but will probably do that in the next week or so. The code was experiments on how to implement retain, release, copying, types, and deallocators. Essentially allowing anyone to implement a certain structure to gain most of this functionality. It was essentially my tests at writing some OOP C code.

    I'm asking for this help because I don't work with or know anyone that writes C code, so I don't have a good outlet for some review. I'd even be ok making contact outside of this forum for back and forth.

    The project is here:

    beheadedmyway's oop_gd_c at master - GitHub

    I would start by looking at the gd_obj* files, and then look at the gd_data* files to see how you'd implement the GD functions.

    Thanks!

  2. #2
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    So I'm going to go out on a limb and say you've read the object-oriented C book. If you haven't it might prove an invaluable resource for a project like this.
    Actually when I started out with C and wanted to move to C++ I learned most of the OOP concepts by learning how an OO system is implemented, and I have to admit it worked very well for me.

    As for your code, I didn't look at much but I liked what I saw. It was clean and concise and there were debugging statements. I don't know about performance but I think in a case like this it might be better just to stick with short, clean code since the performance geeks are going to flock to C++ regardless.
    Consider this post signed

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    35
    Thanks for that link, I haven't read that one yet, it's next! That looks like an invaluable read.

    I actually came the reverse direction, OOP first, then trying to wrap my head around C. I finally got c, so that code was just me experimenting with trying to figure out how you can be more productive with some of the bare minimum things I think should always be simplified.

    You don't know by any chance where you can get the files that are associated with that book?

  4. #4
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    Quote Originally Posted by beheadedmyway View Post
    You don't know by any chance where you can get the files that are associated with that book?
    The author of the document has his own webpage at RIT. You can find the download you need on this page. Or you can just click this for a download of the tar.gz file.

  5. #5
    Registered User
    Join Date
    Jul 2009
    Posts
    35
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Thoughts of OOP and Games
    By Phanster in forum C++ Programming
    Replies: 1
    Last Post: 10-22-2004, 03:06 PM
  2. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM
  3. review code
    By absenta in forum C++ Programming
    Replies: 3
    Last Post: 04-09-2002, 03:13 PM
  4. << !! Posting Code? Read this First !! >>
    By biosx in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 12:51 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21