•

GOOD MORNING CAMPERS!
Yes it’s another Barcamp, this time in Sheffield. Last light saw the pre-camp party, where vast quantities of alcohol were imbued by many, and the rest of us stood around to watch the tomfoolery. We’re now into the registration part of the Saturday session and people are starting to gently dribble in, some nursing serious hangovers. Hopefully we’ll be able to live blog some of the details as we go for those of you unable to attend.
The below are mostly crib notes. I make no claims to the accuracy of the content below, or that the speakers even spoke at the time.
Read more »
•
It’s one of the first keywords every programmer is taught, and it’s the first real sense of control you’re given over your programming. It’s translated into almost every language (there is the odd exception, and they are odd) and makes the basis for every conditional statement there-in.
Yes, we’re talking about the “if” statement. Everybody is familiar with its structure – if condition x is satisfied do this, or else do that, where this and that can be as flexible as you like. Alternatives exist, although most programmers seem to learn to “switch” and stop there. Because all their use cases can be covered with the “if” statement, programmers can become dependant on the “if” statement to perform functions that are better suited by other operators or keywords.
Why make the effort? This boils down to maintainability and readability. By using the most appropriate method to define your “if”, you explicitly state your intended purpose. When the next programmer comes along to maintain your code, or if you revisit your code after a significant time (say a week) the meaning of the statement is inherently obvious and rather than wasting time attempting to understand the complexities of the “if” blocks, you can concentrate on more important things. This is always a good thing. There may be some performance benefits (or occasionally losses) to some of these methods, but for the moment we are focusing on maintainability and readability of your code.
Read more »
•

•
One of the main criticisms of the ASP.NET AJAX approach is the “all or nothing” attitude the components have regards callbacks and updates. This is both a blessing and a curse, for while the AJAX components are very easy to work with, they also introduce significant network overhead and come with their own set of caveats.
Microsoft recognised this, and realises there was a need for a set of Javascript tools as part of the .NET stack to provide better generic Javascript support and to provide some AJAX alternatives. Rather than design their own from scratch, Microsoft decided to provide support for the very popular JQuery library. As of Visual Studio 10, JQuery will be distributed as part of the development kit, but for now you can get a head start with some early support released for Visual Studio 2008.
After the cut, we’ll discuss adding support for JQuery to Visual Studio.
Read more »
•

•

A simple piece of work, a collection of photos taken on a single Autumn’s evening on Brighton Pier. All photos are taken with a 50mm lens on a Minolta XD-7.
Click on the image to view.
•


•
I use generic handlers (.ashx) quite a bit when working with client side Javascript, they’re a good way of getting data to and from the client. I’ll do an in-depth post at some point showing a nice way of chaining generic handlers, JQuery and JSON in a quick way of writing AJAXesque web apps.
For the moment though, a quick tip for people needing access to their session variables in handlers. Because a generic handler is stripped down to its bare bones, you’ll need to import your session state by including a specific interface.
using System.Web.UI.HtmlControls;</p>
<p>public class GenericHandler : IHttpHandler, IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.ContentEncoding = System.Text.Encoding.UTF8;</p>
<pre><code> context.Response.Write(context.Session["name"]);
}
public bool IsReusable
{
get
{
return false;
}
}
</code></pre>
<p>}
Also remember that your session now exists as a property of the context, remember to address it as such.
•
I had a small revelation over the weekend.
Nothing too epic, but an important one nontheless.
I promote reuse wherever I can. I dislike having to reinvent the wheel when someone else has already done an good implementation that covers off most of the functionality I need for a given job.
For example: why reinvent your own ORM and DAL generator, when Subsonic does so well? Why write your own Javascript library to perform basic client side functions when JQuery fills the spot so well, that even the Blue Monster have taken it on board? And why spend the time writing your own blog engine, when there are so many good ones that are constantly maintained by a large community.
I should practice what I preach.
So, last night I finally put a halt to my blog engine. It’s undergone four or five complete rewrites and has never made it to the point I consider “production”. There are chunks of it which will get reused elsewhere, but for now it’s time to explore new projects. And so, in its void I’ve decided to use Wordpress. My partner has been using Wordpress for several months now, and as a blogging platform it seems reliable enough to meet my needs. I can now get on with more writing, more coding and more photography without having to worry about “oh, must get that blogging platform finished so I can post this article!”.
So this should mean you start to see more of me writing. Here’s to the Blogosphere.