Archive for the 'Tips' Category
Closures are a really useful programming construct, but as they’re only just appearing in the C-family languages, they’re relatively new to me. In this article I show how they can be used to vastly simplify event-handler code in web development.
February 20th, 2009 | Posted in ASP.NET, Coding, Tips, c# | No Comments
I spotted a question over on StackOverflow the other day that piqued my interest – “How do you handle scheduling/deadlines around programmers?” – and I thought I’d note down my thoughts since I’ve noticed that a lot of people either confuse deadlines with estimates, or feel there’s some sort of battle between programmers and managers.
February 2nd, 2009 | Posted in Coding, Opinion, Tips | 12 Comments
Correctly controlling content expiration is a tricky thing. You need to balance two goals: getting the browser to cache as much as possible to reduce page load times and bandwidth, versus not showing the user stale content. In this article I’ll cover a simple technique (with code) to solve this issue in ASP.NET for stylesheets [...]
January 29th, 2009 | Posted in ASP.NET, Coding, Tips, Tutorials, c# | No Comments
Deleting a cookie from ASP.NET is something that trips up a lot of people (myself included when I first started ASP.NET coding). Here’s how:
January 25th, 2009 | Posted in ASP.NET, Coding, Tips, Tutorials, c# | 2 Comments
As time goes by, things go wrong with any body of code: we get lazy, bad developers contribute code, the original clean architecture gets forgotten, and so forth. Some bad code is easy to spot: it simply “smells” – once you see it, you know it’s bad. Refactoring this sort of code to remove the [...]
January 20th, 2009 | Posted in Coding, Opinion, Tips | 68 Comments
One of the really nice features of the jQuery JavaScript library is that it allows you to very easily write plug-in methods for it. Custom jQuery plug-ins are called by the end-user in exactly the same way as the core jQuery methods, and make use of the powerful querying syntax. On top of all that, [...]
December 18th, 2008 | Posted in Coding, Tips, Tutorials | 4 Comments
I’ve only been using jQuery for a couple of months now, but I’ve been immediately impressed by its power and concise syntax. I thought I’d present it from my (a developer’s) perspective. I come from a C# background, so this article will be written from that sort of point of view. I’ll start with an [...]
November 27th, 2008 | Posted in Coding, Tips, Tutorials | 22 Comments
The response to my last article (Ten Web Development Tips I Wish I’d Known Two Years Ago) has been a bit… surprising. It’s been viewed 75,000 times so far, wiping out my 3Gb monthly bandwidth allowance in less than a week. (I’ve paid for extra bandwidth now). I’ve received an unprecedented number of comments – [...]
November 24th, 2008 | Posted in Opinion, Tips | 3 Comments
In Part 1 I discussed stack-based representations of functions in very general terms. Now I’m going to present a real-world example. I’ve been working on a new feature for EasyAs123Web.com recently – image cropping. When building your web-pages, we allow you to upload images, and then use them in the web-page, either as simple images [...]
October 29th, 2008 | Posted in Coding, EasyAs123Web.com, Tips | 1 Comment
Back to Basics To most (all?) programmers, the following code is pretty self-evident: Multiply( Add( 1, 2 ), Add( 3, 4 ) ) You expect the value 21 to be returned, and you’re familiar with the idea of representing this as a tree of operations: Fine. Not earth-shattering, but it’s sometimes worth going back to [...]
October 29th, 2008 | Posted in Coding, Tips | 1 Comment