Menu

Run Me Now!

This snippet isn’t so much about code quality, but rather about how NOT to name your functions.
While reviewing plugins on WordPress.org tonight, I found a plugin that contained a function named run(), like this:

function run() {
// do stuff here . . . code omitted
}

This is a really poor name for a function (unless it’s inside a class) because it’s too simple and too likely to cause a fatal conflict with other code running on a site.

Think for a moment, which is more likely to happen twice: a function named mysuperprefix_run() or just run()? Obviously the second.