The exact origin of tatterdemalion is uncertain, but it's probably connected to either the noun tatter ("a torn scrap or shred") or the adjective tattered ("ragged" or "wearing ragged clothes"). We do know that tatterdemalion has been used in print since the 1600s. In its first documented use, it was a noun referring to a person in ragged clothing—the type of person we might also call a ragamuffin. (Ragamuffin, incidentally, predates tatterdemalion in this sense. Like tatterdemalion, it may have been formed by combining a known word, rag, with a fanciful ending.) Soon after the first appearance of tatterdemalion, it came to be used as an adjective to describe anything or anyone ragged or disreputable.