Tom Forsyth on Nostr: Thinking about zero-cost abstractions. Thinking about how I found a bit of C# code ...
Thinking about zero-cost abstractions.
Thinking about how I found a bit of C# code that did:
array = new_item + array;
...and realising a few things:
1. Knowing this is bad is instinctive. Didn't even need to think about it.
2. The person who wrote this has no idea why this is worse than "array = array+ new_item"
3. Nothing in the language would guide them towards this knowledge.
4. This is probably rampant in all the other bits of code I don't see.
5. Zero-cost abstractions never are.
Published at
2026-08-22 19:42:45 UTCEvent JSON
{
"id": "e47242020fc684a2271df7e68e524c10b86d591943f6999b9ddbb1dfd6f54ba9",
"pubkey": "59c5c61181eb766e339fd4da8594510cc8ee73ae967fe4298fafc81c718619d4",
"created_at": 1787427765,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.gamedev.place/users/TomF/statuses/117140866064717603",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "Thinking about zero-cost abstractions.\n\nThinking about how I found a bit of C# code that did:\n\narray = new_item + array;\n\n...and realising a few things:\n\n1. Knowing this is bad is instinctive. Didn't even need to think about it.\n\n2. The person who wrote this has no idea why this is worse than \"array = array+ new_item\"\n\n3. Nothing in the language would guide them towards this knowledge.\n\n4. This is probably rampant in all the other bits of code I don't see.\n\n5. Zero-cost abstractions never are.",
"sig": "7628ff1790048bd49d68d150f4d02d6e242fdbc3875b429c72c6aafc61833220ac8c22d8230ba150527f3fb229586ae97e47b71491a091127e9ea8451efde0c2"
}