Sunday, July 22, 2007

Seven Days

That how many days I've worked in my new job. I getting a little tired of typing "new job", and I probably wouldn't have even looked at this one if Gary hadn't pushed me forward for it, and I got it simply by having a chat with someone who's not even my boss.
It's gone quite well, although I do feel a bit overwhelmed by it. I think Gary's been running the office, and so it may not have been the best idea to start when he was away.
Since he's been back in the office, I've kind of discovered I've been left to pick up one project whilst he goes off and rescues the other one. This is fine, but with a few exceptions.

Firstly, it would have been nice to be given time to get to grips with what the project is, what the technical constraints on it are, and some idea of deadlines before the day before a customer visit (and two days before an apparent payment deadline, which may in fact not be for another four days).

Secondly, the codebase was, and still is, in a mess.
The Data Access Layer is a mish-mash of some code generated stuff (which I have nothing against, just if you're going to code-gen stuff, make the code-gen part of the build), which is quite comprehensive but very difficult to change, some copy-and-pasted components, which to me seem buggy and, in some cases, wrong, and some hand-written stuff to try and hide the mess from the application.
The UI layer is a nasty mess - mostly prototype code which has been altered to use the Data Access. Lots of messing around with values in a datagrid, rather than using the business objects.
The "business layer" is the prototypical Anemic Domain Model.
Overall, there's quite a bit of duplicated code, long methods, and comments explain the what, not the why. Worst of all, this is all legacy code (no tests, and not factored for easy testing). I'm so glad I bought a license for Resharper.
In fact, as I think about it, I'm going to put together my library to take in tomorrow.
Goals for the rest of the week are:

  • Finish the removal of some of the heavy weight code-generated stuff I started on friday.
  • Refactor out some of the business logic from the UI.
  • Educate the team on how to write loosely coupled code. Simple things like CODE TO INTERFACE, LAW OF DEMETER and INVERSION OF CONTROL - perhaps even start a page-a-day club on Jeremy D. Miller's excellent Write Your Own CAB series. (I know I could do with getting the chance to catch up with about half of it all of it).