include("site.inc"); $template = new Page; $template->initCommon(); $template->displayHeader(); ?>
Just as the distinction between programming and scripting languages has blurred in the last few years, so have the guidelines for when you should program and when you should script. The simplest rule remains, though: Use whatever techniques make you productive. In the end, no one really cares if you call it a program or a script.
Even so, these guidelines may help:
*If you have to perform a lot of operations on a lot of RPMs, a program will likely perform much faster than a script that calls the rpm command over and over.
*If the task is relatively simple, scripting generally works best.
*If you are more experienced with a particular language, use it.
*If you need to perform complex operations, perhaps involving transactions, a program is probably the right way to go.
*In many cases, programming languages work better for creating graphical user interfaces, although Python and Perl offer graphical user interface toolkits, such as Perl/Tk or PyQt.
There isn’t one right way to do it. Pick what works best for you.
Cross Reference
This chapter covers shell scripting. Chapter 16 covers C programming. Chapter 17 covers Python scripting and programming, and Chapter 18 covers Perl scripting.