We can rebuild the forum, better, stronger than before

posted by Jeff | Monday, May 31, 2010, 11:22 PM | comments: 0

The forum app at work got a nice trim as we forked off the entire thing to one of the groups that was using it, and with that went all of the one-off customizations and other issues that made it hard(er) to maintain. Portions of the app have also enjoyed overhauls by us, and it's funny how when you have to do something with them, they're a lot easier to deal with. The app was a serious mess when our team took over, and slowly it feels like it's getting under control.

With all of this slimming goodness, and the good times that come with using ASP.NET MVC over Webforms, I've had the urge to get back to POP Forums. While the overall skills are transferable, it's interesting to note that my app and the work app have exactly zero in common. I wouldn't build much of any of that thing the way it was done, and thank God I don't need to use Live ID. Since I decided to do File -> New Project last fall, I wanted to not change any of the database (or as little as possible), which means that my rewrite has its rules written already. It's more of a port to the new platform than anything.

About the only thing that's similar is those actual data access points, which makes sense since I don't want to change the database. What's remarkable, after about four or five weeks of messing with it for maybe six or seven hours a week, is that it's something completely different. There's a whole lot of legacy of crap coding in the old app, to the extent that I rarely look back at any of it. Some of it is at least six years old. Being test driven (well, "test influenced" is more like it) and decoupling the shit out of everything has made me a lot more efficient. I'm realizing that for all of the work I've done for other people the "right" way, I haven't really done it for anything of my own. It's the first time I've really applied my skills to my apps.

My approach was simply to start with the obvious use cases, one at a time, and build whatever is necessary around those. So far, I created a user, let the user login or out, navigate to a forum, post a new topic, display paged topics. The result is about 1,400 lines of code, and another 800 for the data access. Of course, there are 2,000 lines of unit test code, but it's in dire need of refactoring (which I'll probably never do). There is a ton of stuff missing, like text parsing, security action logging and virtually no UI, but even with 60 files, it's so clean compared to what the old app was. The old app was 13k lines of code, and that had no testing to speak of. If I had to guess, the new app will probably have in the neighborhood of half what the old one did. That's bad ass.

I look back at the last four or five years of my own sites, including the forum app, and I think I see the pain points that kept me from evolving them. It mostly comes down to hanging on to a legacy that was toxic. It was too hard to evolve it. The CoasterBuzz rewrite that launched in 2008 was a step in the right direction, but even now I can see how held back I was by everything old. There's the fundamental difference between the personal code and the work code: At home I was bound to what the lesser code monkey (me) did years ago, while at work I was able to easily change stuff that better programmers wrote before me. That's funny to think about, because it's exactly the reasons I didn't want to do consulting work anymore in 2005... I couldn't get better at what I did. Thank God I've had good jobs with good people since then!

MVC has offered a kind of rebirth for me. Because the platform tends to encourage a certain style (the classic "separation of concerns"), you just tend to take OOP and unit testing to the places they're supposed to go (which is not to say you can't still write shitty code). For my experience, these were already skills I used every day, given that most of my professional work since 2005 has been server-side and non-UI in nature, but all of my personal stuff has been very heavily UI focused. Webforms makes it all harder. I know the official Microsoft position is that Webforms isn't going anywhere, but I just assume never use it again.

I still don't know when POP Forums v9 will be done. But I will say that it's a lot more fun to work on than the old versions ever were, and I feel a lot more confident about the long-term quality.


Comments

No comments yet.


Post your comment: