I typically write out the method the long way the first time. Then I refactor it to the most efficient way possible. If the algorithm is complex, then document it!! Don't de-factor it to the point where it becomes less efficent. You have to remember that
a helper like this is used very often so just 2 extra instructions (or memory added) has a ripple effect when dealing with thousands of executions. And since we don't want our users to wait any longer than they have to for the page to be served..... well you
get th point.
pkw_rob
Member
358 Points
78 Posts
Re: Need help with use of LastIndexOf new to C#
Sep 26, 2007 11:20 AM|LINK
Ummm.. I have to totally agree with dre...
I typically write out the method the long way the first time. Then I refactor it to the most efficient way possible. If the algorithm is complex, then document it!! Don't de-factor it to the point where it becomes less efficent. You have to remember that a helper like this is used very often so just 2 extra instructions (or memory added) has a ripple effect when dealing with thousands of executions. And since we don't want our users to wait any longer than they have to for the page to be served..... well you get th point.
Good job Dre.... now get some more points.... :)