Programming Practices

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.

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.

Agile Programming Practices 101 with the Nimble Pros Calendars

For the last two years, I’ve ordered the Nimble Pros Software Craftsmanship calendars, which use ‘motivational poster’ style pictures to depict various software practices and principles worth keeping in mind. Here’s one of the walls at work, where I’ve got the calendars cut up and displayed for easy reference: I like being able to point to a principle when its use pops up, and they provide a nice illustration of things everyone should be aware of. I’ll be following this up with a post on each month’s ......

A Super-Fast C# Extension Method using Expression Trees to Create an instance from a Type

Having written an extension method to create an instance from a Type and been a bit underwhelmed by its performance, I looked into exactly what was happening and have now got it working much, much faster. Here's how.

Clean Code: Writing Readable Unit Tests with Domain Specific Languages

I'm currently reading Clean Code: A Handbook of Agile Software Craftsmanship by 'Uncle Bob' Martin, which includes a section on writing readable unit tests. I've had an article about using Domain Specific Languages (DSLs) to write readable unit tests in the works for a while now, and was inspired to finish it off using a 'clean' unit test from the book.

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.

Full Programming Practices Archive