{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidx4ntqvhikpsplx6lltrcbupmptxuk2qizczhtmcyrvyyopesgri",
"uri": "at://did:plc:vyjlfm46mfv6u4vjp6qtrfx2/app.bsky.feed.post/3mgigef7fkma2"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreidg2k33tiuupnstmiowh7hyyvtsbe3gyhfygiytrzynysnhoctrxi"
},
"mimeType": "image/jpeg",
"size": 81260
},
"path": "/articles/the-counting-machine",
"publishedAt": "2026-02-26T06:30:00.000Z",
"site": "https://thedailywtf.com",
"tags": [
"CodeSOD",
"http://muppet.wikia.com/wiki/Count_von_Count",
"Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. [Learn more."
],
"textContent": "Industrial machines are generally accompanied by \"Human Machine Interfaces\", HMIs. This is industrial slang for a little computerized box you use to control the industrial machine. All the key logic and core functionality and _especially_ the safety functionality is handled at a deeper computer layer in the system. The HMI is just buttons users can push to interact with the machine.\n\nPurchasers of those pieces of industrial equipment often want to customize that user interface. They want to guide users away from functions they don't need, or make their specific workflow clear, or even just brand the UI. This means that the vendor needs to publish an API for their HMI.\n\nWhich brings us to **Wendy**. She works for a manufacturing company which wants to customize the HMI on a piece of industrial equipment in a factory. That means Wendy has been reading the docs and poking at the open-sourced portions of the code, and these raise more questions than they answer.\n\nFor example, the HMI's API provides its own set of collection types, in C#. We can wonder why they'd do such a thing, which is certainly a WTF in itself, but this representative line raises even more questions than that:\n\n\n Int32 Count { get; set; }\n\n\nWhat happens if you use the public `set` operation on the _count of items in a collection_? I don't know. Wendy doesn't either, as she writes:\n\n> I'm really tempted to set the count but I fear the consequences.\n\nAll I can hear in my head when I think about \"setting the Count\" is: \"One! One null reference exception! Two! TWO null reference exceptions! HA HA HA HA!\"\n\n\nBy http://muppet.wikia.com/wiki/Count_von_Count\n\nAdvertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. [Learn more.",
"title": "CodeSOD: The Counting Machine"
}