As of last week, I reached the “top of the hill” in the project I was working on. I had finally got the architecture in place allowing me to begin rapidly filling in the code. Designing and building the architecture is worse not because it’s harder, but because it’s scary. And it sometimes it gets discouraging if I’m not sure I’ll finish the project. It’s sort of like going up a mountain. On the way back down, I have gravity on my side, and it will get done.
The project is to replace the first website I ever made, which was written in PHP, with one written in C#, using MVC 3. (It also involves replacing the desktop app, but 3/4 of that code is being reused directly since it’s still C#.)
www.sow.philipmcg.com —> www.philipmcgarvey.com/gcm
The original website works reliably enough, but it’s no fun to change in its current state. Part of that is because it’s PHP, and I don’t like PHP. In fact, most of that is because it’s PHP.
Because it is PHP:
It is much harder to refactor than all of my C# code.
Because it is harder to refactor, some of the code hasn’t been touched since it was written in my first few days of web development.
I couldn’t share code between the website and the C# desktop app that goes with it. With ASP.NET, code can go in a shared project, which means with good web <-> desktop communication abstractions which I have done, and which weren’t hard to do, I can pass real C# objects directly between the two.
And mainly, it’s just a pain to write good code in PHP. Perhaps this is all my personal bias — but I do think there are good, inherent reasons that PHP is worse than C# for my purposes.
I don’t regret having done it in PHP the first time. It was very easy to get started, and it mostly it just worked. It’s served its purpose for 14 months now — a lot of use has been squeezed out of it.
So back to the topic. Being over the top of the hill, I’ve been able to work morning ’til night filling and draining the todo list, and it’s very satisfying. The project uses Entity Framework Code-First. Now that the site is live (in beta), I’m not regenerating the database, so when I add columns I do it in both the code and the database, but this isn’t that bad and I haven’t had to do it very much.
I want to get this project to a state where it can replace the old one before school starts in two weeks. I’ll get back to work now.