Every once in a while, I come across a movie where I tell myself, "I'm going to read that one first, then see the movie." And usually, it takes me a very long time to see those movies, because I haven't gotten around the reading the book. The Martian is one of those movies. I managed to pick up the book, and then I couldn't put it down (you can read Dotsy's review of the book here) and then I was ready to see the movie.
The movie is a very faithful adaptation of the book, only leaving out or changing what is necessary in order to adapt the story well to film. Mark Watney's sense of humor shines through Matt Damon's portrayal. The book switches perspectives so we, the readers, can see what's happening on Earth while Watney is still on Mars, and that sense of being in two very different places as an observer is preserved in the way it was filmed.
I highly recommend both the book and the movie, in whichever order you prefer.