Archive for June, 2010

search question mark in excel (?)

tried to search for the question mark in Excel but it is treated as a wildcard instead.

Found that the escape char in Excel is ~. Which means “~?” to find a question mark, and “~~” to find a tilde.

http://support.microsoft.com/?kbid=214138

Comments (2)

abc.getXyz()

Why is it not good to keep using “abc.getXyz()” in the same method?

1. This is especially important if you are expecting the same value to be returned for each call. A 2nd call can potentially give you a different result from the first, therefore caching it in a local variable is a good idea.

2. The call may be expensive. Each call may be going through a web service to query a database for the return value. If you save it in a local variable it will only be done once. Even if you “know” that it doesn’t now, you should expect polymorphism.

Comments