They’re very similar. “Competent man solves problems using science, some of which he caused by overlooking things.” But The Martian is more hard sci-fi (or, I guess, more believable). PHM is more fantastical sci-fi.
I’m tempted to say The Martian walked so that PHM could run. They’re both really good, though.