3 ms·
I think it is helpful to know if the check is just a sanity check or if there's an already known set of conditions can lead to that particular error. The funct
by wulczer 14y ago
I think it is helpful to know if the check is just a sanity check or if there's an already known set of conditions can lead to that particular error.
The function comments I also find very useful. Read a few of them and see how much information they carry. Preconditions for the function, reasons why it does what it does, assumptions it makes... These functions are used from throughout the code and it's important to document them well.
I'm purposefully not quoting specific parts of the file, because of course if you look at each and every one of them, you'll find a few that could be improved. But the OP asked for a well commented code base and if PostgreSQL is not one, then I don't know what would be.
- Retric 14y agoI could argue that comments are best for exceptional behavior so if it's normal to do a lot of sanity checks there is little reason to comment on each one. However, my point was saying something like: if (error) //sanity check Saves space and get's the same point across without padding the line count.