Quick Tip: Avoid Enums If Possible
One of the “anti-patterns” I come across from time to time is over-use of enumerations for control flow. This article describes why I consider it an anti-pattern, and how to counteract it.
One of the “anti-patterns” I come across from time to time is over-use of enumerations for control flow. This article describes why I consider it an anti-pattern, and how to counteract it.
One thing I was told as a young programmer was to make good use of assertions for checking code. As time goes by however, I can see less and less use for assertions. I’m starting to think they’re pretty useless.
You’ve been a coder for a few years now, maybe even decades. You’ve got a successful job, making enough money. You know the “respectable” technologies that the recruiters look for: C++, C#, Java, whatever. There’s no need to learn anything new. Stay in your comfort zone. Take it from these guys:
Usually, you don’t want the browser doing any kind of caching on dynamic content served from a generic handler (.ASHX) in ASP.NET – afterall, the content is usually changing (dynamic). Sometimes however, it’s handy to use a handler to serve content that effectively never changes. Here’s how.
Out of the box, Visual Studio uses the Courier New font for displaying code. While that’s an acceptable font for programming, it’s hardly modern or easy on the eye. Did you know that Microsoft supply a much more readable alternative, for free?
Recently I needed to display rotated graphics within a web-page. Since there’s no way to do that cross-browser using CSS, I needed to auto-generate a collection of pre-rotated images that could be displayed as CSS sprites. I’ve found that WPF (Windows Presentation Foundation) is great for generating batches of images suitable for use in web [...]
If you’ve been reading this blog, you’ll know that I’ve been doing more and more JavaScript coding recently. One aspect that’s very different to C# coding is that there’s no explicit notion of ‘public’ or ‘private’ methods. This article explains my own journey towards implementing these concepts in JavaScript.
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.
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.
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 [...]