It is useful to have skeleton or template files that you can just copy and use as a basis for a new script or app.
For example, I use the following ones (emacs with the auto-insert module automatically opens a copy of the appropriate skeleton file when I create a new file).
Perl:
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
my $verbose = 1;
GetOptions("verbose!" => \$verbose
) or die("options error");
C++:
#include <iostream>
#include <stdexcept>
int main(int argc, char** argv){
try{
}
catch(std::exception& e){
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Arguably, one could include basic code for boost::program_options
etc.
What are your favorite skeleton files?