In general, most of Postgres code.
In general, most of Postgres code.
Also, all the long descriptions before function calls are mostly redundant. If i want to know what a function does I can go there and look, but it really should have a sufficiently descriptive name that after the first time I don't need to check again most of the time. Unless something non obvious is going on.
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.
if (error) //sanity check
Saves space and get's the same point across without padding the line count. /* Do we have any named arguments? */
...
/* If so, we must apply reorder_function_arguments */
if (has_named_args)
{
args = reorder_function_arguments(args, func_tuple); /* Fetch the function body */
tmp = SysCacheGetAttr(PROCOID, func_tuple, num_pg_proc_prosrc, &isNull);
Newcomers have be be quite familiar with the internals to immediately see that the line fetches the function body.