Alien Artefacts
brautaset.org
brautaset.org
> The purpose of this blog post is to introduce the concept of alien artefacts1, a subcategory of legacy code. I use the term to describe particularly complicated and important pieces of software written by very smart engineers that are no longer working for the company—and thus not available to support it. The software works really well for what it was designed to do, but it is highly resistant to change.
We have some very wild search code that I think of that qualifies. I also recently added tests & typescript then slowly expanded some really neat code that takes Immutable.js, maps the entities, then caches the result in WeakMap to be re-resolvable latter- sounds simple but there was enough extra stuff also going on & happening that it took some putting heads together to decypher the true inner-workings. Both very distinct features which hadn't had the typical accrual of cruft, mostly untouched since inception, off in their own area. Alien Artefacts feels like a great term.
(BTW what spelling is this? Same word as artifact or no?)
The idea was to be able to switch between DirectX and OpenGL renderers, or restart the renderer from scratch on failure (i.e.: recoverable GPU driver crash, GPU unplug, restore from sleep, etc...). The problem with using a naive OO v-table based abstraction for this is that it incurs indirect call overheads on every call, including calls that are internal to each implementation. So with some clever template programming and multiple inheritance, I got to have my cake and eat it too: calls within a hierarchy of classes specialised for one back-end were always direct inline-able calls, but you could have shared code that was abstracted across different back-ends.
I opened that source file about a decade later and thought: "What crazy person came up with this madness!?" and then saw my name in the commit history. I was the mad one. The call was coming from inside the house.
It helps to rewrite something with example code in hand. You end up understanding everything.
(I did not mean to be opaque; we were a startup and it was hurry-up-and-be-done-yesterday code)
Ah yet another thing no one likes to do: writing tests
Google is good example of this culture.
https://community.cadence.com/cadence_blogs_8/b/breakfast-by...
https://en.wikipedia.org/wiki/Fast_inverse_square_root
Best example of an alien artifact i could come up with on the fly: The using parties do not understand it, but can reuse it. They will have a hard time modifying it. To understand the properties, a deep understanding of math is needed, and how the inverse square root can be mapped to the binary properties of a float.
It seems there is an analogy to python and web programming here - a lot of people can work with things in python/js that are like alien artefacts to them.
Are some areas more prone to alien artefactness than other areas? What about deep learning - how many folks doing it actually understand things vs just use neatly packaged alien artefacts?
If you told a new-grad about how it was built, they might have a kneejerk reaction, since it went against some of the conventional wisdom they'd heard, in school or in blog posts, such as avoiding Not-Invented-Here Syndrome.
You'd have to find a way to convey to the new-grad that, in some situations, a few programmers can consistently accomplish big things that 10 or 100 programmers operating with the usual parameters could not.
But maybe, if we're a new grad, it's a disservice to us to hear that, just yet. Once we're out of school and in industry, there's a phase of really learning and appreciating the conventional wisdom in practice. Much of the wisdom is also a great default for most situations.
But later on, with experience, there's some point at which we can become a curmudgeonly enforcer who insists that a particular subset of wisdom always applies. Or we might be open to recognizing a situation in which the wisdom actually doesn't apply, or doesn't have to apply. Occasionally, there are huge wins from that.
Another colloquialism for this kind of code is "happy fun ball". do not feed or annoy happy fun ball...
That kind of things will for sure go into my domain's blacklist
I'll also accept phone use as a furtherance of the discussion, eg pulling up details, addresses, info, memes to share, etc, but that still all focuses back on us being there together, not you being there in name only.
"I did some research (..), according to the source (..), we know (..), X (..) found out that (..)"
Is different than laying out the knowledge and pretend it was a collaboration between the author and the tool
"the tool", notice the tone, and the personification of the tool by the author, devaluates the people who contributed to the source of the knowledge and everything in-between
I'm not a fan of these "AI generative" tools, not everything is dark tho, i can appreciate how Bing chat always annotate the source of each data it spits; it's a step in the right direction, but I'm afraid this won't be enough to avoid our descent into biased assisted collective intelligence.. perhaps it's over-reaction, perhaps it's the way to go, perhaps it's similar to pre/post electricity, we'll see, but we should be careful, notice I only talk for myself, I have no problem with people using these tools, as long as they disclose it, wich the author did, so I should at least respect that!
I do try to write a wall of comments for each hard-to-understand abstraction I'm introducing, including the rationale for the design, and why I haven't chosen the alternatives. This has been useful mostly for myself, as I'm still maintaining the same code after 12 years (or more, in some cases).
We think "ah we just need this" but then there are multiple corner cases and your nice code turns into a mess