Softcode Efficiency and Tips

Assorted stuff, both on efficiency and general softcode programming stuff. In no particular order.

iter() is evil. Try not to use it. If you must use it, avoid ## in favor of itext(), as the function avoids several potential security holes caused by substituting for ## before evaluation. Many things can be done using other list functions in a constant number of function calls, instead of using iter() and a number of function calls depending on the length of the list. How to do this isn't always obvious. I want to teach a Mush 101 class on it someday.

A lot of people think xget() is faster than get(), because the help used to say so. It might have been true at one time, but no longer. get() is a few milliseconds faster with static strings. Not enough of a difference to matter.

strmatch(string, *foo*) is faster than pos(foo, string).

If you're coming to Penn from Tiny, note that the INHERIT flag behaves differently. In fact, INHERIT is only an alias for the TRUST flag. The only way for an object to have wizard powers is to have the WIZARD flag.

Back
Raevnos
Last modified: Fri Mar 15 21:50:19 PST 2002