Friday, June 19, 2009

Reviewing files from Subversion

Recently I had to deploy some updates to a website and wanted to get a list of all the files that had been updated to make sure I got everything. With recent versions of subversion and using python this turned out to be rather simple:

First, get a list of all the files that have been checked in and stick them in a text file.

C:\Utils\svn-win32-1.4.3\bin>svn diff --summarize -r902:966 svn://myServer/myRepository/myProject/trunk > c:\diff.txt

Then use the following lines of python to get the file names and sort them to make tracking them down easy

mylines = open("c:\\diff.txt" , "r").readlines()
myarr = [x.split(" ")[-1].strip() for x in mylines]
myarr.sort()

Now print out myarr, put it in its own file or do whatever you want with it to deploy or review your updates.

Thursday, June 18, 2009

False Productivity

I'm finishing up a project for a buddy of mine that is in php. It's an old school simple CRUD app and as such I didn't go too overboard with the functionality. It does what the client asked and the code is reasonably clean but not something that you could refer to as having much of an architecture.

Since it is all raw HTML and PHP I had to code everything up by hand. At my regular job we do almost everything in ASP.NET. This got me to thinking as I was working on these two things side by side that, after roughly clocking the hours of similar projects, that a lot of the productivity I've been feeling I've been getting from ASP.NET is false. As one of my co-workers is fond of saying, the complexity has to exist somewhere, all we really do is move it around. This struck me keenly because my layout and design skills are not great, so even coding up a simple interface that does what it is supposed to takes a little bit of effort and since I'm not using any frameworks at all for the PHP app, I got to code it all by hand. In the APS.NET world you would drag and drop a couple controls and be done. Poof!

But, then, the data access layer coding began. And the DAL for the PHP app was dead simple to code. And it wsa doing some reasonably interesting things. Nothing crazy, but a couple joins here and there, you're usual stuff. In ASP.NET, once you go outside their little box, things become somewhat painful. I've had instance where putting together the interface was drag and drop a few things and then the prototype of the data access was a few minutes of drag and drop but then things start happening. The production data has millions of rows and your test data only has a few thousand, so the paging and access for the paging needs to be recoded. Oh, wait, there's a fancy new datagrid widget doo-hickey that your manager read about somewhere. Can we use that? And on and on with the little things that make a seemingly quick and simple job time consuming. Just like that the productivity you thought you had gained went up in smoke. In some cases it actually gets worse because you either have to start over or make what your additions fit into what you've written already AND make it fit into the ASP.NET universe.

I guess the point here is that things aren't always as time saving as they appear. I know people say a lot of things. My language is X more productive than yours. You get demos from vendors showing how easy something is. Three drags, a double click and a pinch of salt and you have a fully functioning app! Just be suspicious of such claims. Chances are the three drag demo has little resemblance to the actual work you do.