Both were entertaining, but the movie was more of a popcorn action flick while the book tried to explore the realities of war and a warrior led culture.
The Heinlein estate holders didn't like the movie so much, they have refused selling movie rights to any other book. So you won't see The Moon is a Harsh Mistress because of Starship Troopers.