[Mono-list] Determining the platform at compile and run time
Fergus Henderson
fjh@cs.mu.OZ.AU
Fri, 31 Oct 2003 18:39:23 +1100
On 31-Oct-2003, A Rafael D Teixeira <rafaelteixeirabr@hotmail.com> wrote:
> I could use your try/catch solution, but I prefer to use "decisions
> construed over known information" than "try/catch" for performance reasons.
If that's the only reason, then another alternative that does not use
try/catch is to use reflection to see which interfaces are present.
But basing the decision on minor performance issues like this seems like
a bad reason anyway, since this try/catch or reflection code only needs
to be executed at most once each time the program is run. After that,
the result can be cached in a variable.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.