What does a principal developer do?

Or to word it another way, What is a Principal Developer?

I recently got asked this question at an internal (non-technology-based) event with about 50 people in the room. With a mixture of stage fright and not being able to provide a single one-sentence answer, I copped out with “It’s complicated, we do lots of things”.

Some of the alternatives might have been:

Like a developer but a lot better

I can’t argue with this, I am quite awesome. Apart from displaying an unattractive amount of hubris, this is also not true. You won’t get very far in software development if you consider yourself to be aloof to the rest of the developers out there as there are so many intelligent programmers – you can create an Ayende type coding machine role in an ivory tower (not to be confused with a coding machine for out-of-work personal projects¬†of course) – but ultimately the hive mind is a lot more powerful in software development than a single one; and you also make far more mistakes with the solo-coder attitude.

Continue reading What does a principal developer do?

.NET logging libraries compared

This is a short presentation I created for the company I work for, and gives my thoughts on the state of .NET logging libraries in 2014. My knowledge comes from day-to-day use of MSEntLib and log4net and moving from TraceListener to NLog in Roadkill. The presentation comes from a web and windows service perspective.

Using Appveyor as Roadkill’s CI to run acceptance tests

A while ago Roadkill’s CI solution was hosted on Appharbor, which was a great solution (and free for a single project), but the configuration hacking and I problems with the hosted environment with the unit tests meant it wasn’t a viable solution for Roadkill’s requirements.

After Appharbor I moved onto using Bamboo from Atlassian. This, like Appharbor, was also a great hosted product but was costing me a lot in Amazon EC2 hosting costs which I was too cheap and miserly to pay for.

I then moved onto Teamcity which is the CI I’m most familiar with, having set it up and used in two companies over the past 5 years. Right now, the Teamcity mothership is hosted on DigitalOcean and a Teamcity agent runs on my desktop PC to run the build. I’m also too cheap with this solution to keep it running 24/7, so I launch it on demand which is really when I do check-ins to Roadkill.

A few days ago I heard about Appveyor through the grapevine and decided to give it a try with Roadkill. Appveyor does all its instancing via Azure, but also lets you control the instance using post-install and post-build powershell hooks rather than the completely sandboxed approach of Appharbor.

So far I’ve been impressed at how easy it is to use, but also how customisable your instances can be.

With a post-install hook I installed Chocolatey and then Chrome and MongoDB (with SQL Express 2012 already installed):

Continue reading Using Appveyor as Roadkill’s CI to run acceptance tests

A C# UK bank holiday calculator

In the UK we’re fortunate enough to get 5 free holidays a year, under the guise of “Bank Holidays”. These are mostly on Mondays and come in January, March/April, May, August and December.

Below is a calculator for working out the dates of these holidays, along with tests for the next 5 years. The class tells you if you’re on a bank holiday, but could be easily changed to return the bank holiday dates. For now, it doesn’t tell you if you’re on the Boxing Day bank holiday.

Continue reading A C# UK bank holiday calculator

Adding NETWORKSERVICE as a dbo user in SQL Server

If you want to enable integrated security in your SQL Server connection string, and don’t want to have to update your App Pool with a username across different machines you can simply add ‘NT AUTHORITY\NETWORK SERVICE’ as a dbo for the database you’re querying.

You can also add “NT AUTHORITY\LOCAL SERVICE” too.

Obviously this isn’t recommended for production use, and shouldn’t really be used in larger teams or multi-environments (staging, live-staging, live) setups.

Roadkill reaches the magical 1000 unit test mark

Warning: this post contains large amounts of pro-automated-testing propaganda.

Roadkill is now up to over 1000 tests (around 1150) as it gets near the version 2 release coming in 2014. Around three hundred of these come from the Markdown parser that Jeff Atwood wrote, and the HTML sanitizing toolkit, but the others have all accumulated over the past year including a lot of retro-fitted tests which were written to aid refactors. The test coverage is now around the 75% mark according to Jetbrain’s DotCover tool:


Continue reading Roadkill reaches the magical 1000 unit test mark

Using the this keyword with Typescript and a jQuery function

When you write Typescript, you’re forced by the compiler to use the “this” keyword when you want to access member variables or methods. If they’re static, you’re forced to use the name of the class (as you usually would in C#, although it’s syntactical).

This can cause problems when you bind jQuery button clicks to your own methods, and want to access member variables inside that method, as you are now inside the scope of the jQuery event and no longer your class. It’s one of the great ‘features’ of Javascript that the C# team overcame quite easily with lambdas, and in standard Javascript you usually overcome it by referencing the class instance in a variable named “that”, if you’re use Douglas Crockford’s pattern.

Continue reading Using the this keyword with Typescript and a jQuery function

Anti-XSS .NET libraries in 2013

One of the more important parts in Roadkill Wiki is removing malicious HTML from the markup that’s entered, even when the markup (Creole and Markdown) is controlled.

The markup you enter is converted into HTML, and then sanitized internally to remove any HTML that is bad, the markup can also contain HTML itself – the Creole parser allows this as does the Markdown parser to an extent.

Malicious HTML usually comes in the form of XSS (Cross Site Scripting) attacks but can also be more innocuous but annoying things like showing Javascript alert() messages on the page or doing a Myspace style butchering of the stylesheets on the page.

For the most part Roadkill Wiki doesn’t need this level of sophistication in its text parsing,
Continue reading Anti-XSS .NET libraries in 2013