Sam was very smart, he just put his master before himself.
He had better common sense than Frodo... I mean, come on, look who trusted Gollum and who didn't. Sam knew all along.
Also, Sam learns what he can - look at all of the old poems and songs he has memorized...
I guess he still acts slightly juvenille (as when he almost drowned to stay with Frodo), that's what I would say, but he was indeed smart.
|