Thisss omfg. I actually love to think about how characters were coded, esp universes.....
I really love to think of Dream and Nightmare coding wise being almost completely the same. In fact, to such an extent that Nightmare's code is literally copy/pasted from Dream's with only a few variables changed here and there. If you were to have a look, you'd find multiple large chunks of code with comments like "// Dream's torso" or "// Dream's left leg" etc etc etc. The only parts that would be corrected to actually say Nightmare would be things that actually differ, like personality or his eyes being purple.
With their orb forms specifically (seen below LOL) I like to think between the two of them, the only difference in their code would be a single boolean (TRUE or FALSE value) deciding whether they are made of positive or negative energy... because then it sorta has this narrative add-on where legit they could've been very very similar if it weren't for how they were treated as children by the villagers. Whole nature vs nurture thing ykyk lmao
As for universes, I think it should be stated that Undertale's code is. Not the best! Fun fact, did you know all of Undertale's dialogue is one giant switch statement? For those without any programming knowledge, there are better ways to do this LOL.
But that aside, when coding an AU, I definitely think there are multiple ways to do so. I love to think the way Error actually destroys universes is that he actually is able to corrupt data... based on this bit of dialogue.
When Error goes to destroy an AU, he does state that he has to inspect it a bit, before nabbing the human to prevent any resets and such... undoing his work. When he does inspect though he's subjected to however a creator has made their own world. I really love to think certain worlds are harder to destroy for him just because the code is unreadable EHAHAHA.
For example, take these two simple programs I made in about 5 minutes:
Functionally, they do the same thing - take in a whole bunch of numbers given by the user and then spit out an average of all those numbers. However, where these two differ is that the first one is fucked to read - shitty variable names (pissShit, shitpiss, i hardly know her!), no spacing, no comments. Versus the much more readable second version where you can actually get an idea of what's going on. (I know the example is probably unneeded LOL but I like rambling and yapping. Sue me :P)
So there's Error, and sometimes he'll get very neat and tidy universes that are easy to read, understand, comprehend, etc etc. Hooray!! And from there he can be real slick with his destruction - maybe change a few important variables here and there and then immediately watch a world crumble into nothingness. Easy in and out job. Flawless. Sleek!
But then sometimes he'll come across this hellish AU - code completely incomprehensible. The creator decided it would be a good idea to use both the variable names "Fucked" and "fucked" and he didn't notice the capitalisation for an embarrassingly long time. Or they decided for whatever reason to write their AU in the joke programming languages Brainfuck or LOLCODE. And he'll go around crushing random bytes in a temper tantrum out of frustration only to see a single tree being deleted from existence, and then Ink decides to show up and it's all horrible and nothing goes his way ever. >:[
I also like to think he has to deal with these sorts of comments in his code... HEHAAHA (These are all from Simpsons: Hit and Run).
But yes..... ramble over.......... wah