“Meatloaf code” is code that is there since a long time but nobody remembers why it’s there but everyone still respects it and keeps writing things that way. I call that “meatloaf code” based on the following anecdote that I read in one of my books, except I can’t remember which one so I apologize for not attributing it correctly… oh, now I do, must have been one of the Richard Feynman books.
“My mother often made meatloaf for us kids. One day I was watching her rolling the meatloaf, cutting off both ends and placing it in the pan. I asked her why she cut off the ends and she said that her mother taught her to do it that way, but she didn’t know why. After a bit of arguing back and forth, we called her mother and asked, and got the same story. Her mother in turn taught her to do that but she didn’t know why. A week passes and we go visit my mother’s grandmother and then we ask her why she taught her daughter to cut off the ends of the meatloaf, and she said: because my pan was too small back then. Don’t tell me you’re still cutting off the ends, are you?!”
Today I saw this: a textfile that serves as a printer template and begins with a tag like “[START]” and ends with a tag like “[END]”. All templates have to have that. Before sending it to the printer, you have to strip it out. Nobody knows why, but everyone does it.
Now that is meatloaf code.