Monday, March 26, 2012

...but when I do, I do it in production

So, I finally gave up my fight against the masses and decided to create my first blog ever (I'm still fighting though, e.g. I don't have a Twitter account...but I'm quite tempted to get one). I also wonder if I should curse or thank my colleagues for encouraging me to start blogging (maybe they're the ones that will regret this later on), only time will tell.

First question probably is that what are you going to find from here. I wish I could tell you, I usually have more than a few things in my head that I want to write about (at the moment of writing this I have six drafts here and few coding projects waiting to be finished and shared) but my problem is that I always end up polishing them until end of times. I think it is safe to say that there will be code, a lot. Most of it is probably Tridion related due to my current job.

I guess the other part of the blog will be my thoughts about the software industry in general but in stereotypical Finnish way I'm a man of few words, that is, unless I'm ranting about something or if I'm having a few beers, so don't expect too much.

You can find some code that I've written from GitHub. I'm planning to provide full-blown projects there for any code samples I might share here (or other way around, base the code samples on some project I have in GitHub). If you're new to Git/GitHub then you should start from here and here. Suffice to say I selected GitHub because of the ease of contributing to projects so anyone interested in my examples can contribute or reuse my code. Unfortunately I haven't released a lot yet but I hope that I can get it growing considerably during this year.

I guess I should also explain the title of the post (and url of this blog). It all comes from the time I started with Tridion almost 2 years ago and was working on my first Tridion-project (at the time I wasn't working for SDL though). During one day I was demonstrating TOM.Net API for a customer and the first question I got was "So, how do you write unit tests for your templates?". Of course inexperienced as I was I answered without flinching something in manner of "Well, you just mock the classes and test your logic, just like you would do without Tridion". People with Tridion experience can probably guess how wrong my statement turned out to be...

As some people might know, I might be quite stubborn sometimes. And most of all, I'm not really one to accept defeat easily. So naturally ever since that occasion I've been on a never ending quest to prove myself right, that you can unit test your Tridion templates. My latest endeavor to solve this can be found in StackOverflow (Please contribute if you have any ideas!). I know there will be a beautiful day when I can finally write see that lovely green color of passing tests in my (Tridion) template code. On that fateful day I do not have to test my code in production anymore...

(For the nitpickers: Yes, you usually test your code in dev/test/acceptance/whatever first but I've seen cases where the input differs enough for the code to fail in production but not in others, so ultimately you test your code in production)

tl;dr: Hello World! Welcome to my first blog, Here I will be writing mostly about code (probably a lot is Tridion related due to my work). And if you're wondering, URL of the blog comes from the fact that I can't always test my code even though I really want to :(

1 comment: