Programming Practices

Naming Things Is Hard: Using Object Pattern Names

Design Patterns - tried-and-true solutions to common problems - have now been around long enough that many of them have very familiar names. We can use those names as part of an object-naming strategy.

Node.js and TypeScript Modules: Internal, External... Shake it All About

When I decided to write a JavaScript game, I knew I'd need to run the same logic on the server and the browser, so Node.js was an obvious choice. It's JavaScript on the server, right? Anything I write to run in a browser will be runnable on the server as well. Easy! Well… not so much. Here's the misunderstandings and problems I faced, along with my solution.

Dependency Injection, Angular and Node

My current pet project uses Node, Angular and TypeScript. This is my first time working with Node or Angular and the differences in the way they approach Dependency Injection led to this post.

Naming Things is Hard: Keeping Context in Mind

Nothing that you name in coding exists in a vacuum. It will all be used and referenced in a certain way, and this should inform the names you choose. Here's some examples.

Finding a Balance: Code 'Complexity'

On any project, there's a tension between writing code everyone finds easily accessible, and using more [relatively] modern techniques which make code more terse and expressive. Here's some thoughts on addressing that tension.

Naming Things is Hard: Method-Naming Patterns

Some of the method-naming patterns I've come across / developed / adopted.

Extending WatiN 2: Wait for JQuery document.ready() Functions to Complete

WatiN's DomContainer.WaitForComplete() method pauses test execution until the DOM has finished loading, but if your page has functions registered with JQuery's ready() function, you'll probably want to wait for those to finish executing before testing it. Here's a WatiN extension method which pauses test execution until that happens.

No More NCrunch For Me

NCrunch is a Visual Studio add-in which runs your tests while you work so you know if you've broken anything, as well as providing coverage indicators in the IDE and coverage metrics on demand. It recently went commercial, and time is running out for the free version I've been using for the last couple of months. From my experiences using NCrunch I'm going to let it expire, and go about my business without it. Here's why.

Naming Things is Hard: Dictionaries

I've been working with a codebase recently which makes a lot of use of dictionaries - here's a few words about naming them.

Naming Things is Hard: Finding the Right Level of Abstraction

It is said and experience has confirmed - in programming, naming things is hard. So hard it's common for programmers with years and years (and years) of experience to regularly name things poorly. Here's some of the processes I use to name variables and types, focusing on finding the right level of abstraction.

Full Programming Practices Archive