The second analogy is ok, but again not really great if you want to understand what's actually going on. If you just want to get an intuition that DNA has something to do with storing information, as long as that comes with an understanding that information evolves (biology is really the study of evolution in many ways), that's probably more than enough for a layperson. But it's a dangerous understanding if you plan on using it as a foundation to try and explore more complicated topics in biology. There's no need to do so, but if you are going to, it's far far better to spend the time getting the correct first-principles understanding and get rid of this idea of "DNA as source code" so you can better grapple with the subject.
I don't think the first analogy makes much sense since it makes nucleotides the sort of active agents here and needlessly focuses on individual nucleotides when codon triplets are what are involved in coding for proteins (probably better to, if you have to use an analogy, treat nucleotides as letters instead of words). And, especially in the context of this thread, neither analogy build the understanding needed to really dive into what RNA is, which is important for understanding what RNA viruses are, and what the coronavirus is.
Also, you really should include activation sites etc, but soon your out of the realms of analogy and just describing the details.
I guess we could visualize it as a series of drains, where the size of the hole can be modulated. Since gene expression can decrease or increase the rate at which DNA is transcribed
> The workers, raw materials, and signals to turn sections on or off are separate.
People are used to the idea of thermostats using on/off to maintain temperature which is not a terrible association. As you say gene expression is different, but I can’t find a better analogy.
I think the best analogy is DNA is a series of automated assembly lines. The workers, raw materials, and signals to turn sections on or off are separate. Each nucleotide station is called A, T, C, or G and adds a single element at a time to long chains which then get folded up into useful tools. DNA can also be used to manufacture either more stands of DNA or to do very simple repairs.
Alternatively, a stack of computer punch cards with a program on them. In that it’s a standard format for information transfer that is physically altered by the message it carries. Further, on it’s own nothing happens but connected to the right machinery it’s useful.