function naming.txt 1.5 KB

123456789101112131415161718192021222324252627
  1. My style of function naming may seem a little bit odd (and, I would agree) but
  2. there is a method to the madness that I will try and explain here for you all:
  3. I'm making an attempt to modularize as many datastructures as I can, making it
  4. so people can only interact with them through the header files; I'm guessing it
  5. will cut down on bugs by forcing people to reuse already existing functions
  6. instead of writing their own, which are known to (hopefully) work correctly.
  7. I've tried to distinguish between functions designed to interact directly with
  8. datastructures (e.g. get and set methods) and those that actually have some
  9. functionality to them (e.g. sending messages to sockets, combat routines, etc)
  10. by using different casing. Functions that are deisgned to interact directly
  11. with a datastructure are in CamelCase and everything else is in snakey_case.
  12. For functions in CamelCase, functions should take a naming syntax like:
  13. [datatype][routine][target] (e.g. roomGetName, roomRead). The exception is
  14. for creating and deleting datastructures. For doing these things, it is always
  15. [new | delete][datatye] (e.g. newList, deleteChar).
  16. Hopefully this will explain the seemingly odd programming style you see in my
  17. code. Undoubtedly, this is a very bad convention to use (I would be better off
  18. using one type of casing or the other) but that's life, I guess. Perhaps in a
  19. later version, I will go through and redo the function naming conventions.
  20. Geoff Hollis
  21. hollisgf@email.uc.edu
  22. http://www.uc.edu/~hollisgf/