Sunday, March 29, 2009

Notepad++

I was looking the other day for a good free program that I could use for program code editing and I found a real gem. Notepad ++ is a really great program if you like doing any type of programming from HTML to C++. I've used many programs in the past. I love Microsoft Visual Studio, but am not willing to shell out the $1,200 (or some rediculous amount of money) for the program. That's what brought me to see if there was a program out there that at least highlighted stuff for me. It doesn't have "predictive text," but with the huge number of add-ons that someone has probably done that.

Anyway, last week, I was troubleshooting a report at work. The report was based in SQL language and had over 22,000 lines of code. Last year the report worked great, this year it kept crashing and actually bringing down the entire server sometimes. I was told that "nothing had changed" on the database side between last year and this year and it must be a probelm with the report. Well, the report hadn't changed either so I went to the SQL to investigate. Unfortunately, I don't have the time to manually check 22,000 lines of SQL. So along comes Notepad ++ with it's compare add-in. It is awesome. The compare add in compares two files together, so I saved down the last years report SQL and this years report SQL to text files and compared them.

The add-in analyzes each line of the text file and shows the files side by side. Any line that is completely different on one side or the other gets highlighted and a line gets inserted in the other file to allow you to keep the matching lines side by side. Any lines that look almost the same get highlighted in a different color with the differences highlighted in a darker shade. All lines that match 100% don't get highlighted. With 22,000 lines of code, after running this add-in it took me about 2 minutes to find the problem. Turns out that "nothing has changed" was not quite 100% accurate. There is a setting called "Full Outer Join" that isn't a good setting to set as a default for the entire database, that somehow changed from last year to this year.

If you are looking for Windows notepad on super steroids, give notepad++ a try.