Sunday, December 25, 2011

Going to School

I'm an old school web developer. I've been on a bit of hiatus since I've last worked on web applications. The last time I was half-decent developing web applications: I was using some form of scripting language. Be it: PHP or ASP.

I think that developing applications back then was so much easier. It was fairly straightforward. I used to always create the same things though. There were boilerplate concepts that you could use to create a user, session ... how to use cookies ... hashing passwords. Coming back to create a web application under best practices is absolutely harder than I thought.

I wanted to use the NHibernate ORM. I didn't want to read (how silly of me) any books. I wanted to be able to Google / StackOverflow this. I have a policy about reading technical books. That policy is that I have to be familiar with the technology first. It sounds a bit backwards, but if I read a book first and then try it ... it will feel irrelevant or less valuable. If I struggle a bit and then read the book I can immediately form a link. It's just how my brain works.

Anyways, NHibernate, NuGet, ASP.NET MVC 3, Ninject, Log4Net. I also wanted to do things properly and follow some standard patterns. I read multiple arguments about the repository pattern versus unitofwork pattern. Arguments against each of them and all sorts of jazz. I read about RSignal. I felt as though I had too much to get off the ground to get a project up and running.

It took me three days to figure out how to use Dependency Injection properly. I'm also confused as to how Ninject figured out how to do constructor injection into my controllers without writing any sort of logic like is necessary for Castle Windsor.

I also had to use BCrypt to hash my user passwords to guard against rainbow attacks. Bloody hell, is all I say.

Also trying to make this thing localized properly has been a pain in the ass as well.

I'm not using any MembershipProvider BS either. I'm doing my own thing entirely. I have to write a wrapper for this entire thing.

What else do I have? I think TDD is awesome, but it's not good for exploratory coding. In my opinion, performing unit testing is awesome and should be done for ensure functionality works. However, if I knew exactly how to approach my design, I would be using TDD. Right now, I'm just guessing at what I'm doing, so I'm not going to use TDD. I don't want to rewrite the interface and subsequently, X number of tests.