Thursday, August 1, 2013

Sitecore - The deep end

I suppose I should start off introducing myself, and explaining how I got into Sitecore. My name is Bruce Thwaits, I’m 31 years old, married with a 1 year old daughter. I live in Cape Town, South Africa. I’ve been in dev for around 7 years, having worked for banks, investment houses, and even other media companies. I currently work for Primedia Broadcasting, a media company with 4 large radio stations, and a growing network of CMS-driven websites.


The first of those sites was a news site for Eyewitness News (EWN) - the project I have primarily been involved in since day one. The original site was built by a team of 3, including myself, but for the better part of the last year, I’ve been the sole dev on the project, so I’ve had to delve into the depths of Sitecore without much interference. I’ve learned some interesting lessons along the way, and I hope I can share some of them with others, to perhaps save some of you from some of the mistakes I’ve made along the way to where I am now.



Anyone that has ever worked in Sitecore knows that the learning curve can be pretty intense, especially if you are getting into it without co-workers who already have experience and can guide you as you learn.


In this post I'm going to take you through my general learning process from day one to now, and explain how I had to find most of the answers for myself, with little assistance. Even if you’re in a team with more experienced Sitecore developers, I still encourage you to follow these steps to figure your way around Sitecore, as I still think these are vital parts of the process I followed to where I am now, where I feel like I finally have a solid understanding of how Sitecore works.


Google
I can’t express enough how valuable this is to any developer, whether fresh out of school, or a 20 year veteran. Whatever problem you’re encountering, whatever complicated construct you’re trying to build, someone else has done it before. If you find the right words to enter into google, the answer will jump out at you. With a wealth of Sitecore blogs, sometimes you get extremely lucky, and there’s a step-by-step guide on how to do exactly what you need to do.



Poking through the existing Sitecore code
This is one that’s not a natural thing for most developers. You’re used to using 3rd party tools that come packaged in black box dlls that you are sure you should never mess with. Well, that’s not how Sitecore dev works. Most of the time the logic you want to change is deep inside a Sitecore dll, and rather than writing your own logic from scratch, it’s merely a change to one line of code retrieved from a decompiler. If you’re a Sitecore dev and you don’t have a decompiler like ILSpy, dotPeek, or Reflector on your pc, you’re going to struggle more than you need to.


In fact, the best way to look at it, you’re not writing a new app from scratch. Think of it like you’re extending the functionality of an existing solution. Then you’ll be more willing to reverse engineer the existing code, as if it was merely a dev working for the same company as you that wrote the existing code, rather than a mysterious team of devs from another company.





Don’t be scared to experiment
A lot of what you want to do in Sitecore isn’t obvious, and the final solution isn’t what you think it will be. Rather take a step back, break the problem down, and experiment with each piece of the puzzle until you have it all working. You’ll surprise yourself with the solutions you come up with. I recently solved a particularly tricky CMS UI problem by using some custom javascript embedded into a XAML control to call codebeside methods using parameters calculated client-side in the js. If you’re expecting for everything to be nicely packaged into codebehind c#, you might find that issues are harder than they need to be.

No comments:

Post a Comment