The parameter order of cache_set() does not follow Drupal's coding standards. Ref: http://drupal.org/node/318.
Arguments with default values go at the end of the argument list. Always attempt to return a meaningful value from a function if one is appropriate.
cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL)
Specifically, since $data is not default, it should occur before $table.
cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL)
Writing the function the second way also allows porting of 4.x.x modules to 5.x and higher without rewriting all cache functions.