>>One should code for reliability and correctness first (i.e. the code should do what it should do), then for speed. Speed should also be measured in everyone's time: if my two hours of work will save the users at least ten hours a year, it's worth it. If I'd have to work two days to save them five seconds a year, it's not. I did have to work a couple of decades to be able to make an educated guess between the two, though.
>
>Also - I have seen many situations where clients are unhappy with performance but the programmers are unable or unwilling to improve things.
Ah, those situations... well I guess you don't meet those guys on this forum too often. I do hear horror stories from colleagues here, who happen to see third party apps in real life, where the authors of those are worse than you can imagine.
>This is all beside the point of my question - how can I dynamically - at compile time - replace a UDF with a native approach.
This thread is old enough to have bifurcated many times. It may accidentally get back on track :).