Hi C. -
There's an old wive's tale that says a child develops his/her general personality traits at age five and after age seven, it's very difficult and nearly impossible for him/her to change the bad habits.
I certainly don't subscribe to that belief, but in my own personal experience with my younger brother, who's now 30, he was a colicky baby, a whiny toddler, an ornery teen, and a VERY moody adult. My father is very similar in nature, so I'm sure my brother picked up on a lot of bad habits just from being exposed to it in his environment. Is there any one in your household who's whiny? Does your eight-year old whine? If so, maybe your son thinks whining is the best way to get his point across. I don't know how much control parents really have over their kids' personalities, so it's almost a wait and see kind of thing. While I have some pretty serious jerks in my family, my husband's family has quite a few complainers, so to some degree, I have to wonder if bad behavior is not just learned and developed, but inherited too.
Of course, your son's whining at ten-years old is a behavior issue, which needs to be addressed with strict discipline. I wouldn't necessarily advocate spanking him at his age, however, taking away things he likes and/or special privileges will really wake himself up to the reality that you're not willing to put up with his bad behavior any longer. Giving him extra chores like raking the leaves, washing the car, and other things that would seem detestable to him may work too.
Another method that I used when I had to manage 80 teenagers, who bagged groceries at a military commissary was to make them offer me a solution to their "problem" BEFORE coming to me. If they came to me with a whine, complaint, tattle, etc., I would only hear them out if they provided a solution. I made sure that they knew I wasn't obligated to employ their solutions, but at least they knew I would listen to their issues, which is mostly what they wanted anyway. Getting them to come up with solutions encourages them to use their minds in a more proactive than a reactive way. Speaking of being proactive, maybe you can take him out on his own, and spend some time getting to really know him at this age. Even though everything seems to be going fine at school and in his life in general, maybe he has some fears and anxieties that he doesn't really know how to express.
Like I mentioned before, only time will tell. Hopefully, your son will develop the presence of mind to realize that he can catch more bees with honey than with vinegar.
Blessings to you and yours!