The only rationale you give is to imply both activities are telling something what to do. But does this stand up? When you write a book, are you 'telling' the book 'what to do'? No. Or maybe telling the person reading it what to do? In which case, are you expecting them to behave exactly according to your 'instructions'? No, not really.
Literature and software are two very different things.
If you're writing, say, the Amiga Boing Ball demo, or Dali Clock, you might be leaning more towards art.
But if you're writing software that controls transactions for a bank, you're definitely more an engineer.
What does it matter anyway? In my rather short career so far, I've been an artist and an engineer, a scientist and a craftsman. Sometimes all in the same day.