Can Linqpad help stop stupid programmers making stupid mistakes?

The stupid programmer in this case being me as I have just wasted the best part of two days over the last week trying to track down two weird bugs, both of which ended up being idiotic mistakes on my part and were not related to where I thought the problem was.

Whenever this happens, I try to find some way of stopping myself from making similar mistakes in the future and was wondering if there was any way LinqPad can help.

I would take too long to explain all the details, but basically the first bug was because somehow a string had got changed and now included an invisible character !

I can't think of any reason why a script should ever contain invisible characters, so I was wondering if Linqpad could display a warning if it finds any. Personally I don't even think code should contain a non-breaking space character unless it is encoded.

The second was where I was amending a class that implemented ICustomMemberProvider , which was > ten times slower that it should be. Turns out that I had a NRE which Linqpad was catching and recording in the log file. (Over 5 million entries added the log file yesterday and nearly 2.5 million today.)

It know it would be easy for LinqPad to increment a counter when it writes to a log file, but would it be feasible to display a warning if the counter reaches a very high number.

If not, I think I am going to write a routine that runs in the background every few hours and alerts me if it detects any weird characters in any of my scripts or if the log file grows too big.