12 Aralık 2011 Pazartesi

Writing a .Net debugger in 15 mintues

Hi,
I found this interesting link via tweets.

It creates mini dumps on each exception with whole error stack.

Worth to look..

Worst case: Waste of 15 minutes :)

http://tripleemcoder.wordpress.com/2011/12/10/writing-an-automatic-debugger-in-15-minutes-yes-a-debugger/

8 Aralık 2011 Perşembe

Epic Fail

Some code fragments I have seen so far...

- Being sure of the type (!)

 " ".ToString()
"".ToString()



- Creating sql queries in code:

string query = "SELECT * FROM Customers WHERE customerName '" + customerName + "'";

no parameter, no string.Format()

Better version
string query = "SELECT * FROM Customers WHERE customerName LIKE '%" + customerName + "%'";

yeah.. using LIKE.. with no reason.