Posts

Partials in Spark View Engine

Continuing my journey with Spark , the next natural stop for me after the basics was “partials”. I am a uber-fan of DRY (almost fanatical) so was keen to try and cut down the dupe of HTML etc. I thought I would share the “partials basics” for both you and me :) What Are “Partials”? “Partials” are basically snippets of HTML/”code” markup that can be used throughout your MVC application. This reduces code duplication and helps keep your site maintainable. It can also make your markup easier on the eyes, since you can isolate chunks of markup into “units of functionality” (e.g. a “navigation bar”). What Are Partials NOT? UserControls . People often relate/confuse partials with user controls, and they are NOT. While UserControls can encapsulate HTML, code behind, events and be packaged into assemblies etc. Partials are still (or at least should ) be pretty “dumb” views. Why Use Partials (and MVC) When UserControls Do More? If you are more interested in mashing up code with ma...

RCP: Spark View Engine Bootstrapper

So, tonight I had a RCP session with @JohnnoNolan – we decided that for our topic, we would like to “File > New Project” and see what it is like to replace the default ViewEngine in ASP.NET MVC with the Spark View Engine . Why Spark View Engine? I have heard a lot of buzz about it from the developer community. Also, I heard the podcast on Hanselminutes and the notion of it all just sat right with me - there shouldn’t be such an epic battle between HTML/C# in your views. Our sole purpose in the View is to render HTML based on some model data – make it easy . RCP Session Aims Neither myself or Johnno had any real experience with Spark before the session. As a starting point, I thought it would be good to cover what I would consider to be the “basics” for views: Using variables from ViewData. Using strongly-typed model data. Using master pages. I decided to spend 1 hour before the session having a quick run-through of the install process and the basics in th...

TomatoTimer Now on GitHub

Not sure if you guys remember me talking about TomatoTimer in the past , but after some thought I have decided to whack it on GitHub as a public repository . Why GitHub? Cos it’s awesome. Even when it fails it’s awesome because I think Octocat is awesome :) Why a Public Repo? Put simply, there are people that were interested in using the application, and there a couple of bugs in it that I can’t guarantee a fix time on. I am not (and likely to remain not) invested in WPF applications at all at this time. I am instead focusing my efforts on ASP.NET MVC. So, rather than keep people waiting, I thought I would throw the code online so they can at least use it. If it just so happens that someone sees the problem and they send me a pull request, even better. Where Do I Get the Code? You can get (read-only) access to the repository here : http://github.com/robcthegeek/TomatoTimer . The code is C# 3.5, with a WPF front-end. xUnit is used for testing, and Rhino Mocks for mocki...

“Getting Started with Ruby” Kata

I have been having talks/ideas for some time about starting a bit of a affair with Ruby . As a .NET geek, you may be wondering “why?”. I don’t want to “go on” too much here, if you’re curious about these, please feel free to ask: It’s Designed for Programmers It’s Dynamic and Not JavaScript Rails Looks Interesting Massive Community Movement/Involvement Strong Open Source Community I got thinking. I want to get started, but have no idea where to begin. I make no claims that I am anything other than a complete n00b. So, I started feeling my way through the darkness and decided to try and formalise it into a kata that can be repeated. NOTE: This is totally a “bootstrapping” kata – if you have done anything beyond the basics with Ruby, this is of no good to you! The Kata Problem Create a simple class that returns a number formatted as a percentage. For whole numbers, “zero” decimal places should be removed, for fractions, they should be...

DDD8 - A Big Thanks!

Yesterday, I attended the DDD8 ( #DDD8 on Twitter ) conference at MS Reading. I went to the DDD gig last year (also at Reading) and had a great time, so did turn up with high expectations! I just wanted to put a post up with my thoughts on the day/sessions in the hope that: It gets more people involved (be it talking, attending or sponsoring). People know I am grateful for the free event. General Organisation I found the day to work out nicely – thanks to SqlBits , this year we had coaches pick us up from Reading train station and take us straight to the MS campus. This must have saved the geek collective a good amount of cash. Plenty (IMO) of food was laid on, welcomed to MS with a nice sausage and bacon roll and a brew. Breakfast of champs :) As with all events like this, there are always a clash with sessions you want to go to. I have no idea how you can fix this and please everyone – so I am not going to moan. But it is a plus that there were so many good se...

New Year, Intentionally Late New Start

So, I have been reading wave after wave of similar posts. I guess it is finally time to do mine.. Looking Back Last year was a great year for me, I learned a lot about myself, GTD, sleep and TONS of stuff to help me continue improving my craft. That said, all is not rosy. I can’t help but feel I did loads but got nothing done . Towards the end of the year, I really started “getting” my GTD process (mainly the addition of Personal Kanban). I crashed out with burnout, and then spent the holiday season thinking and reflecting on where the hell I went wrong. Looking Forward Personal Kanban (with “ Lean ” in the mix) introduced reinforced the concept of “only adding value”. I say reinforced, because us geeks should already be familiar with the concept . “Why is that?” you ask? – Well most of us geeks have heard the term YAGNI right? Agile peeps use it all the time. Put simply, “it it ain’t worth it – don’t do it”. I need more YAGNI in my personal life. Writing badass code mea...

First RCP “Open Spaces” Style Session

Following on from a great three-way RCP session , wanting to keep the idea of remote programming sessions going - I’ve had another! This one was a session with a twist. There was an “Open Spaces” session planned for Saturday – sadly though, the day was cancelled. So, thanks to the marvel that is Twitter - myself, Jeremy Skinner ( @JeremySkinner ) and Mark Embling ( @splashtech ) decided (pretty much on a whim) that we will have an “Open Spaces” style RCP* session. * Still struggling to come up with a different name for this style of geek get-together.. Loose Plan Now, “Open Spaces” sessions really do rely on having, well, spaces . And since we are each sat in our home offices this proved interesting. Loosely, this is what we decided before the session: We each throw down some ideas of sessions we would like to complete (we listed these in Google Wave). We would pick the sessions we want to do as-and-when. If a session was not proving useful or productive, we wo...