Scripting has been a recurring theme in this column. It wasn’t planned that way — but the fact that every article to date has featured scripting in some way shouldn’t be overlooked.
Scripting has been a recurring theme in this column. It wasn’t planned that way — but the fact that every article to date has featured scripting in some way shouldn’t be overlooked.
When a program is scriptable, you can apply the program in novel and inventive ways. Better yet, if a program is scriptable, the work to extend the program can be distributed and delegated.
Can’t highlight C# in vim? Just copy the Java configuration file, add and subtract a few keywords, and you’re done. Need to convert ASCII text to an image? Check the Web for a suitable GIMP script (http://lemur.ecs.soton.ac.uk/~cjg/script-fu/).
Simply put, adding scripting to an application is powerful stuff. Provide some basics and all the hooks and leave the rest to your user’s imaginations.
While the concept of scripting isn’t new, it has only recently come into vogue. As a result, programmers often rush in with the best intentions to enable scripting, but don’t pause to consider or research prior art. Developers tend to reinvent the wheel or impose their own biases towards this language or that. For example, if a programmer’s favorite language is Python, he may make his application scriptable only in Python. This may not seem that harmful, but consider what could be achieved if biases could be transcended.
This month, let’s look at several approaches to scripting to see what works and to learn what to avoid.