I didn't see this mentioned in the article, but you can protect against this in your own scripts by including a -- before user-supplied parameters, which prevents them from being treated as flags.
$ rm -- -rf
rm: cannot remove '-rf': No such file or directory