Archive for the ‘Uncategorized’ Category

MVC, Webforms & being pragmatic

It was interesting to see the announcement from dotnetnuke that they would not be migrating to MVC.

I’m familiar with dotnetnuke from a few years back when I was running The Website Shop and looking for a .net alternative to Joomla. It was awesome then and it still seems to be a strong option for those seeking an open source Cms platform.

The subsequent heated debate on Twitter and the blogosphere was amusing, as all such discussions are. I love the passion amongst the developer community.

Scott Guthrie provided some interesting insights, but what rang in my ears at the end of the article was the following:

“Syntax and APIs are rarely the most important thing anyway when it comes to development – problem solving, customer empathy/engagement, and the ability to stay focused and disciplined on a project are much more valuable.”

This is interesting, I’ve always felt that besides technical nous being pragmatic and resourceful are essential skills for a developer to have. Most of us work for businesses where we have to be sensitive and diplomatic to the needs of the business and such skills can really help with this.

As much as we strive to craft beautiful code and at times often sit in a near sublime trance, as our code becomes art and takes on a life and beauty of it’s own, the day to day practicalities are that we often have to leave technical debt or implement things in ways that we might not be completely comfortable with because of pressure from the business to get things done as quickly as possible.

We are in the process of creating a new “Experts” Q&A section for gurgle.com in MVC and we are already seeing enormous gains even whilst in development, as we refactor some of the common functionality to MVC. We’re quite sure that eventually we will build out the whole public facing site in MVC.

However, we also have a bespoke Cms that services the front end and is used internally by the editors and business administrators. The Cms has a whole bunch of ASP.NET web form controls and uses ASP.NET Ajax and the Ajax Control Toolkit. Since SEO and performance is not a priority on the backend, like the dotnetnuke team we’ve also decided to stick with web forms on the Cms, not because we believe one technology is better than the other but simply that at this point in time in the life of gurgle.com ASP.NET MVC is the better technology for the front end and ASP.NET web forms is more suited to the back end.

This is the best of both worlds for us, we get to improve our skill sets by using MVC whilst maintaining our existing ASP.NET Web Forms knowledge.

So ultimately being pragmatic about your choice of technology allows you to add value at many levels, and satisfy the priorities of others as well as yourselves.

Culture ‘en’ is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread’s current culture.

Ran into this one today after a couple of Mac users reported a bug.

The application was having problems converting DateTime values.

When I looked at it I noticed that the users browser language was set to ‘en’.

I drilled down to the offending code:

public CultureInfo VisitorsCultureInfo
{
   get { 
     return CultureInfo.GetCultureInfo(
        HttpContext.Current.Request.UserLanguages[0]
     ); 
   }
}

The developer has used the browser setting which equates to the CurrentUICulture, which as Peter Ritchie explains is incorrect.

.NET has the concept of a UI culture (for localization of resources) and an application culture (for the globalization of data).

Since we are working with dates (data) we should be using the CurrentCulture property.

The following article demonstrates a better approach.

So the bug has been resolved, and I can have a worry free weekend!

Here’s the fix:

public CultureInfo VisitorsCultureInfo
{
  get { return System.Threading.Thread.CurrentThread.CurrentCulture; }
}

At the coalface

Gartner, the world’s leading information technology research and advisory company have revealed the top 10 technologies that they believe will change the world over the next four years:

1. Multicore and hybrid processors
2. Virtualization and fabric computing
3. Social networks and social software
4. Cloud computing and cloud/Web platforms
5. Web mashups
6. User Interface
7. Ubiquitous computing
8. Contextual computing
9. Augmented reality
10. Semantics

Right up there at number 3 – Social networks and social software.

I consider myself very lucky to be working in this area today and I really enjoy it. I remember working for an e-commerce start up at the turn of the decade and it’s got the same exciting feel to it – like we’re building the platforms today that people will be using for a good few years to come.

It was a really exciting time but the bubble did eventually burst and I moved on to more mundane business related activities which eventually bored me to death. This time, however, I’ve got a nice little salary protection plan and much clearer long term goals if things do go pear-shaped, suffice it to say I’m making hay whilst the sun shines!!!

Another commitment

As if I haven’t got enough to keep me exceptionally busy, I’ve now decided that I should start blogging.

Well I was kind of blogging anyway (if you count around 5 or 6 articles over the space of about 18 months entirely devoted to generating adsense revenue, the outcome of which was one of those “I can’t be arsed” type of lethargies after I made only $7) but this time I’m doing it for real and by that I mean I’m not in it for the readies, I’m just talking about what I love doing which, fortunately enough is also what I do for a living.

But wait, before you withdraw muttering about “another techie blog” , didn’t you notice the title? Well, the point is that although I shall indeed use my blog to post about my software development activities, there shall also be some (hopefully) interesting tidbits about my observations in and around the colourful and creative Soho area in the West End of London, where I am based, anecdotes about life in general and possibly some shockingly revealing insights into what it is like to be me (well, what it is like to be an extremely busy Dad, anyway!).

So lets hope that somehow, somewhere out there, somebody might just stumble across my blog and take a smidgin of pleasure out of reading what I have to say. If that does indeed happen, then I shall be delighted to count this endeavour as having been worthwhile.

TNT!

P 🙂