George <greerga@CIRCLEMUD.ORG> writes: > I seem to have a C attitude and you seem to have a C++ attitude. I prefer > checking when asked for and none when I don't want it, you have the "must > check everything" attitude. When we get into all of the 'extras' you throw > into the functions such as weather affects on AC, yes, it should either be > a function or a separate macro. I don't think my attitude is very C++; I like C++ but I don't code in it regularly, and I think the language has some issues (stemming from immature compilers mostly). My point is that error checking is an important part of a robust codebase. Moreover, since people use these shorthands often without checking validity, crashes happen, corruption happens, much more often than it needs to. You may be a perfect coder, but no one else is ;) Adding these checks would not be that much overhead. It would be a little work now, but it really isn't that bad. If you check data when you access it, instead of when you set it, then you can easily get corrupt data. If you check when you set it, though, then you don't have to check it each time you access it -- which can save a lot of time, as well as clearing up code. Branching every time you call GET_TITLE to make sure it's a valid string distracts from the purpose of the function. -- James Turner turnerjh@xtn.net http://www.vuse.vanderbilt.edu/~turnerj1/ +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST