gitweb: how to name main "action" subroutines?
I'm going to rename some gitweb subroutines to better correspond to what given subroutine does. I have problem: how to name main "action" subroutines? Currently they use git_ prefix, e.g. git_logo. git_project_list, git_rss, git_summary, git_heads,...
I have thought about do_logo, or gitweb_logo, or out_logo etc., but somehow none is best.
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
Quoted 7 lines · --- Jakub Narebski
I'm going to rename some gitweb subroutines to better correspond to what given subroutine does. I have problem: how to name main "action" subroutines? Currently they use
git_prefix, e.g.git_logo.git_project_list,git_rss,git_summary,git_heads,...I have thought about
do_logo, orgitweb_logo, orout_logoetc., but somehow none is best.
"git_<noun>_<verb>" ? So then you'd have, for example "git_logo_show".
Luben
<opublikowany i wysłany>
Quoted 10 lines · Luben Tuikov
Quoted 7 lines · --- Jakub Narebski
I'm going to rename some gitweb subroutines to better correspond to what given subroutine does. I have problem: how to name main "action" subroutines? Currently they use
git_prefix, e.g.git_logo.git_project_list,git_rss,git_summary,git_heads,...I have thought about
do_logo, orgitweb_logo, orout_logoetc., but somehow none is best."git_<noun>_<verb>" ? So then you'd have, for example "
git_logo_show".
I'd rather reserve git_ prefix for subroutines which deal with git repository, either by calling git commands (e.g. git_get_type), or accessing git repository directly (e.g. git_read_hash, git_read_description).
I'm partial to either out_foo or gitweb_foo...
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
Quoted 4 lines · you
I'm going to rename some gitweb subroutines to better correspond to what given subroutine does. I have problem: how to name main "action" subroutines? Currently they use
git_prefix, e.g.git_logo.git_project_list,git_rss,git_summary,git_heads,...
print_* or write_* ?
At least, the functions print/write the HTML code to stdout of the script.
Josef
Quoted 3 lines
I have thought about
do_logo, orgitweb_logo, orout_logoetc., but somehow none is best.
Quoted 8 lines · Josef Weidendorfer
Quoted 4 lines · you
I'm going to rename some gitweb subroutines to better correspond to what given subroutine does. I have problem: how to name main "action" subroutines? Currently they use
git_prefix, e.g.git_logo.git_project_list,git_rss,git_summary,git_heads,...print_* or write_* ?
At least, the functions print/write the HTML code to stdout of the script.
The problem is that there are subroutines which print _fragments_ of HTML code (like git_header_html or git_print_page_path) which would use probably print_ prefix. Action subroutines output always whole page.
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
Quoted 8 lines · Jakub Narebski
Quoted 6 lines · Josef Weidendorfer
Quoted 4 lines · you
I'm going to rename some gitweb subroutines to better correspond to what given subroutine does. I have problem: how to name main "action" subroutines? Currently they use
git_prefix, e.g.git_logo.git_project_list,git_rss,git_summary,git_heads,...
Quoted 6 lines
Quoted 2 lines
print_* or write_* ?
At least, the functions print/write the HTML code to stdout of the script.The problem is that there are subroutines which print _fragments_ of HTML code (like
git_header_htmlorgit_print_page_path) which would use probablyprint_prefix. Action subroutines output always whole page.
Why not "print_*_page", if they print out a whole page? I would "git_header_html" rename to "print_header"; it's clear that it prints out HTML ;-)
And "git_print_page_path" only needs stripping of "git_" prefix.
Josef