Python - 1 : C# - 0
I tend to get chided when I mention to my developer friends that I prefer to work in Python if I can. Python is a general purpose language that helps me get my personal projects done faster with less coding. I'll follow up with a post on things I like and dislike about Python on another post later.
At work we work exclusively on Microsoft SharePoint Server with C#. One of our developers was trying to write a routine that would write 50MB of data from MS SQL Server to Excel. Using C# our guy couldn't get the run time to be under 30 minutes. To me, 50MB isn't a lot of data. There's no reason that it should take that long.
A quick Google search to find a Python module to connect to MS SQL Server turned up PyODBC. With the excellent pyExcelerator library installed I was ready for battle. Fifteen minutes† and thirty lines of code later (including timing code) I had a quick prototype in Python working that runs in 49 seconds. Down from 30 minutes, that's a 3573% speed increase. Needless to say my co-workers were all dumbfounded that Python would be so efficient over Microsoft's flagship language. I admit that I was pleasantly surprised as well but mostly just so that I wouldn't have to eat crow when it didn't work ;)
†The only reason it took fifteen minutes was because I had to familiarize myself with PyODBC and how to execute stored procedures with it. After fetching the data it was only two simple for loops to get the data written.
![[link:home]](http://thebuckpasser.com/images/home.png)
![[link:about me]](http://thebuckpasser.com/images/aboutme.png)
![[link:rankings]](http://thebuckpasser.com/images/rankings.png)



There are no comments for this entry.
[Add Comment]