“Any sufficiently advanced technology is indistinguishable from magic” - Arthur C. Clarke 
 Today I’d like to talk about LLMs. But first, I’d like to talk about an impressive invention from the late 1700s. 
 The Mechanical Turk 
 The Mechanical Turk 
 - or “The Turk” as people called it - was an autonomous chess-playing machine. Built…
Have you heard the news? 
 
 AI is replacing all developers next week - or in 3 or 6 or 12 or 18 months! 
 And somehow at the same time, AI is helping developers get jobs by “cheating” in tech interviews! 
 
 Don’t those two things directly oppose and contradict each other? But I digress. 
 The thing is, AI replacing developers is straight up impossible ,…
Recently in CodeSession 
 I encountered the following logged warning: 
 
 No XML encryptor configured. Key {6848a46f-d0d6-49a6-b035-0f30f5448f9d} may be persisted to storage in unencrypted form. 
 This was totally new to me, so I started Googling. There I learned all about .NET Core’s Data Protection 
 API. 
 After reading the MS docs, this was still…
It’s amazing how quickly 4 years can go by. But I’m back to blogging, and promise to follow this post with more regular entries going forward. In fact, I already have a technical topic scheduled for later this week, and plan to return to Engineering Management topics in the coming weeks as well. 
 So what have I been doing since my last blog post over 4 years ago? LOTS .…
Hi, I’m David Haney. I currently live in the Detroit Metropolitan Area of Michigan with my family. We moved here in late 2023. Prior to Michigan, I lived in Florida for 14 years. Prior to that, I was born and raised in Canada. 
 I have been programming most of my life. We didn’t have a lot of disposable income, but my dad was given a home computer for his day job which was quite…
Well, once again I’ve fallen off of the blogging wagon. And once again I am now getting back on said aforementioned wagon. Let’s try and make this a more regular thing than once a year or so, shall we? 
 I recently built a quick little hobby site / side project with .NET Core MVC. I have a lot of experience with ASP.NET MVC but I was totally new to .NET Core MVC. As a result, I had…
Sabbatical week one is complete, and I’m finally finding some time to blog about it! 
 I had a pretty active week. It started with hurricane preparations as Dorian burled toward Florida, however in the end we suffered a very light glancing blow. In short, we got off easy. 
 The Bahamas did not get so lucky, however, and got pretty messed up. I’d love for you to take a moment to…
One of the most amazing perks of working at Stack Overflow is the sabbatical. After 5 years of FT employment, you are entitled to 20 paid days off (outside of normal vacation) that you can spend however you please. My sabbatical officially begins on Tuesday (as Monday is a holiday).
Practically speaking, I am out from Aug 31 - Sept 30, returning to work Oct 1st. This is an amazing opportunity…
In this post I’d like to show you how I ported an Azure Classic Cloud Service application (which cost me $16 USD a month by the way) to a .NET Core Azure Function, and now host it in Azure for $0 a month! That’s right - Azure Functions are both awesome and (usually) free! 
 Introducing realDonaldTron 
 So back in late 2016, when our dear leader was elected president, I decided…
It’s been a while since I changed things up, so I decided on a new Twitter handle and blog domain. 
 This site is now hosted at davidhaney.io 
 and called “David Haney” which in my opinion is a much better (and more descriptive and maybe even more egotistical) domain than haneycodes.net 
 and the old name of “Haney Codes .NET” 
 Don’t…
A few weeks back I wrote this tweet: 
 I did a presentation / speaking thing last week that got me thinking: would it be useful to blog about how to build a resume as someone new to tech, from the perspective of a hiring manager? I might whip that up today or tomorrow if people like the idea. — David Haney hachyderm.io/@haney (@haneytron) July 9, 2018 


 43 likes later,…
Well I failed badly in my mission to blog every week of 2017. I guess life and stuff just got in the way in the end. I’ll try to be more consistent in the second half of 2018. 
 Anyway, I bring some news: I have a new blog engine, and we are hiring at Stack Overflow! 
 New blog engine 
 I was previously using WordPress but had many issues and concerns with it. One of the biggest…
This post is for those of you who hire developers, and also junior developers who want to be hired. Let’s talk about how developers are just like individual stocks in the stock market. Time for a little role-playing: you’re now a stock market investor. 
 As a financial advisor, your company has given you $2,000,000 USD to invest in the stock market. It’s made very clear that the future of the…
In case you missed the big news in the industry this week, a GitLab employee accidentally deleted a ton of production data 
 and took their platform down for hours. It was only when everything was on fire and they were in deep trouble that they turned to their backup systems… only to find that none of them actually worked. 
 Backup Prod Data Regularly 
 Not exactly a…
In part 2 of my series on dev team interactions, I’d like to talk about conducting good code reviews. Most dev teams will find themselves in a situation where code reviews are necessary, and in my experience many do them very poorly. I’ve even worked in companies that had such a negative code review culture that people left the review sessions upset, even considering quitting. With a few easy…
As a developer working for a company, you probably work on a team. The interactions on these teams are sometimes pleasant, and other times hostile. What’s interesting to me is that a lot of the time, a hostile interaction could have been a pleasant one if only approached differently. Hostile teams are created by the actions of the people on them, not by the situations they encounter. One such…
If you’re working on an application built using ASP.NET MVC, you’re hopefully aware of the OutputCacheAttribute 
 attribute which can be used to statically cache your dynamic web pages. By adding this attribute to a controller or action method, the output of the method(s) will be stored in memory. For example, if your action method renders a view, then the view page will be cached in…
Well, I’ve utterly failed to blog at regular intervals, writing only 
 three 
 posts 
 in 2016. Ouch. To be fair, one of those posts is insanely famous (the one about NPM and left-pad.js), but still, I’ve really let my readers – and myself – down. 
 So, I resolve to write a blog post every single week of 2017, starting today. This will probably mean that I write…
On Plumbers 
 Picture this situation: you woke up this morning to find that there’s no water coming through your valves and taps. No sink water. No shower water. Having no plumbing experience, you call around for a plumber. 
 Plumber #1 
 Plumber #1, let’s call him Mario, tells you he can’t be bothered to come check out your issue because it’s minor and he’s very important and too busy…
Intro 
 Okay developers, time to have a serious talk. As you are probably already aware, this week React, Babel, and a bunch of other high-profile packages on NPM broke. The reason they broke is rather astounding: 
 A simple NPM package called left-pad 
 that was a dependency of their code. 
 left-pad, at the time of writing this, has 11 stars on GitHub 
. The entire…
Are Developers Good Negotiators? 
 Developers come from all walks of life, and have many unique interests, passions, and hobbies. Often the only thing that developers have in common is their love for programming. It follows that some are good negotiators; others get the double digit percentage finance rate at the dealership when they go in to buy that new car. 
 How Does Your Company…
Background 
 I’m going to discuss an important topic that affects everybody in tech: diversity. 
 No, this won’t be some preachy post about how diversity is great and how you should be a better human being. Rather, I’m going to tell you about the things I’ve experienced working on diversity – particularly the interesting events of the last few days that happened internally at Stack…
In February of 2015, I was promoted to Engineering Manager at Stack Overflow. This has made a lot of people very angry and been widely regarded as a bad move 
. 
 There are tons of things I’ve learned so far, some of which I’ve learned the hard way. There’s also a world of difference between managing code, and managing people who code. Your day to day work routine changes completely.…
I was working on my fireplace this past weekend. Specifically I had just finished ripping down the old surface to the red brick, and then preparing the brick surface with a layer of thinset for tiling. I spent all of Saturday cutting tiles and then placing them on the fireplace surround and hearth. Even with help it took 11 hours to do, and about 8 hours of it was measuring and cutting tiles.
Today an article was brought to my attention. One that, at the time of writing this post, had hit the front page of various sites (including Hacker News) and had been shared over 2,600 times. The article is On Secretly Terrible Engineers 
, which is a criticism of the tech industry and the mentality which it holds towards hiring both new and experienced developers/engineers. 
…
A Job Listing 
 Let’s say you were walking down a street one day and noticed an ad for help wanted. It is posted in the window of a bakery. It reads: 
 
 HELP WANTED: 
Need a baker for FT work. Must be familiar with modern baking methods such as ovens, barbecuing, and deep fryers. 5+ years experience with the Super 6 commercial baking oven required (aside: came out in 2014). Nice…
Intro 
 We’re just two days from a brand new year and yet the primary measurement of a developer’s skill seems to be the same as it was 20 years ago. The most important classification to most companies is job title, as I talked about in great detail in my last post 
. The job title is acquired via working for a veritable slough of credentialist companies whose HR departments break it…
Intro 
 I’ve had a good career so far. I began working full-time as a programmer in 2008. At that time my title was Junior Developer . I had a decent boss and cool co-workers, and I cut my teeth on Java and .NET. It was a good experience. After 2 years at that gig, I felt that it was time to move on. 
 I contacted recruiters, and one eventually found me a promotion: Systems Analyst . It…
Intro 
 Like many of you, today I watched the Apple media event in which they announced both the iPhone 6 and Apple Watch. I’m not going to talk about the watch, but instead about the phone. 
 For years Apple has been a true cachet brand. They are a luxury item that is sought after for status and image. I don’t blame anyone for owning an iPhone: they’re reasonably sexy and you get to show…
Intro 
 Almost exactly 1 month ago today I found myself on a video call with Joel Spolsky. It feels insane to write that, even now, as it was a banner moment in my career. For me it was the equivalent of meeting a movie star who I had idolized since I was old enough to know what movies were. There had always been this Joel Spolsky guy throughout my career that I regularly read about and whose…
The Problem 
 I think that most devs would agree when I state that the definition of success in the corporate world of development places less emphasis on “good” code and more emphasis on “working” code. Working code is code that can be released to production on or before the deadline, regardless of performance or even bugs in most cases. As a developer, you ultimately feel as if you’ve failed…
Intro 
 Node.js – it has rapidly become the “new hotness” in the tech start-up realm. With each passing day, the fan base of Node lovers grows larger, spreading their rhetoric like a religion. How do you spot a Node.js user? Don’t worry, they’ll let you know. 
 One day you’re at a regular user group meeting, sipping soda and talking with some colleagues, when the subject turns to Node.…
It looks as if the Visual Studio dev team may be implementing a new operator in a future .NET release. This is due in large part to community demand, which is pretty cool because it shows that the VS team is listening to their customer base; a key part of a successful product. 
 This new operator is likely going to take the syntax of ?. and is known as the Safe Navigation Operator .
I recently came across an ASP.NET MVC issue at work where the validation for my Model was not firing correctly. The Model implemented the IValidatableObject interface and thus the Validate method which did some specific logic to ensure the state of the Model (the ModelState ). This Model also had some DataAnnotation attributes on it to validate basic input. 
 Long story short, the issue I…
Jonathan Allen of InfoQ conducted an interview with me about one of my open source initiatives, SimplSockets . We discussed the value of TCP over HTTP and why Sockets are still relevant to programming. 
 I’d like to thank Jonathan and InfoQ for the opportunity – it was a great discussion. Check it out here: http://www.infoq.com/news/2013/12/SimplSockets 

MVC4 made one simple and yet awesome improvement to View rendering that I don’t think many people are aware of. 
 Have you ever had to conditionally add an attribute to an HTML element in your MVC View based on the presence of a variable? The typical use case is applying a CSS class to a div. Most of the time that code looks something like this: 
 <div @(myClass == null ? "" : "class=\"" +…
The T4 template engine is insanely powerful. I didn’t really realize just how powerful it was until I had a use case for it today. I stood up a database with about 40 tables in it, and planned to use an ORM to access the database. To use the ORM, I needed POCOs (Plain Old C# Objects) that represented my database. Some of these tables had 30-50 or so columns and I didn’t want to code all of this by…
If you’re using the Web API as part of the MVC4 framework, you may encounter a scenario in which you must map parameters of strange names to variables for which characters of the name would be illegal. That wasn’t very clear, so let’s do this by example. Consider part of the Facebook API: 
 
 Firstly, Facebook servers will make a single HTTP GET to your callback URL when you try to add or…
Have you ever had to write a comparer for a specific type, only to be frustrated when you needed to write a second and third comparer for other types? Fear not, a generic comparer can take care of this for you! 
 /// <summary>
/// Compares two objects of any type.
/// </summary>
/// <typeparam name="T">The type to be compared.</typeparam>
public class…
I wanted to point people to this link at DotNetPearls: 
 http://www.dotnetperls.com/binarysearch 
 
 They do an excellent, quick demonstration of List<T>.BinarySearch and show a graph that really drives home how much faster it is for large lists than a regular traversal!
One of the many things that I do at work is run a full-blown Search Engine which I also developed from scratch. This Search Engine feeds all product related information to our websites. A search index consists of a pre-computed collection of products, their properties, a list of words that are correctly spelled, and some pre-computed faceted/guided navigation. A search index, until this week, took…
In the interest of self-improvement and sharing knowledge, I felt that I should share an update to my last post. I discovered a slightly better way to create the GetMimeMapping delegate/method via reflection that involves less casting and overhead, and is more Object Oriented in a sense. It allows the signature of the reflected method to be Func<string, string> instead of MethodInfo. Code below,…
I recently had a need, in an ASP.NET MVC3 application, to read raw HTML, CSS, JS, and image files from disk and return them to the user… A sort of “pass-through” if you will. Normally I’d have simply routed to a custom HTTP handler per file type or just allowed MVC3 to map existing files to supply its own .NET HTTP handlers and do all of this work for me, but in this case I needed the mapped…
As of today I’ve been published in an e-Book offered for free by Red Gate! It is called 50 Ways to Avoid, Find and Fix ASP.NET Performance Issues and contains many useful performance tips which have been contributed by various members of the .NET community. Many tips are ASP.NET MVC specific which is also a plus. 
 My tip is #3 and has to do with debugging Microsoft symbols. 
 Get a free…
Most of us have been there: you’ve written a fantastic application that performs perfectly in your Development and/or QA environments, but in Production something goes wrong. Your application spins out of control, utilizing 100% of your CPU. Maybe it simply stops responding as if it were deadlocked. Or maybe it simply crashes randomly. What now? 
 Logic tells you that you have a problem in the…
So, this post is about our beloved IDE instead of actual code. 
 I recently upgraded my home PC from Visual Studio 2010 and 11 Beta to Visual Studio 2012. The very first thing I noticed was that after about 10 minutes of programming my Intellisense quit working and never came back. I thought to myself “what the hell Visual Studio? 2010 didn’t have these problems?!” and then, after a swig of…
A friend of mine commented on my last post asking about how much faster the static string.Equals method is than the instance string.Equals method. To satiate both of our curiosities, I have created this benchmarking application: 
 static void Main(string[] args)
{
 var stopwatch = new Stopwatch();

 string a = "hello";
 string b =…
As you may or may not know, static methods are usually faster than instance methods . This alone should be a good enough reason to use the static string.Equals method in .NET, but if that doesn’t do it for you, allow me to present a simple example. 
 string a = "hello";
string b = "hi";
bool result = a.Equals(b);
 
 What is the expected result of these lines? A…
Well, it’s been nearly 2 months since my last post… I’m learning that if you want a blog to be successful, you have to carve time out of your busy life and make it happen. So, with renewed focus, I re-enter the fray. 
 The Joel Test is a curious and honest thing. It has been around since the year 2000 and was invented by a guy named Joel Spolsky, as the name might imply. In short, it’s a very…
This isn’t a very technical post, but I was published by Microsoft recently via their MSDN UK Blog! The article is on creating and maintaining a successful User Group. 
 Click here to read the article!