Picture a rulebook.
Picture a rulebook for a new ballgame.
The rulebook reads only, "Bring a ball to an open area, in the company of friends. Have fun using the ball. Tip: try throwing the ball, or kicking it with your feet."
That's not a ballgame. It's not rules to a ballgame. It's an activity, involving a ball.
In the same way, Dungeons & Dragons is not a roleplaying game.
A lot of people disagree with this. Among these people are a very small number of highly intelligent insightful individuals, who are in this case wrong in a highly intelligent insightful way. But the rest are simply people that have never played a storytelling game developed after 1990.
Dungeons & Dragons - and I write this while currently involved in no less than three 4th Edition campaigns - is very, very bad at handling roleplaying. It's not a roleplaying game. It may, if you feel charitable, be a roleplaying activity.
The reason I say this is that there is not a single mechanic within the game that supports, enables or encourages roleplaying. Picking any edition of the game from its origins through to today, that statement is true.
But, you say, the rules say the GM may award experience for roleplaying. Which was true, under the rules up to 3rd Edition. The current version of the game doesn't even mention this concept, although it could in some way be worked into the idea of "XP for overcoming encounters". But even under the old systems, a couple of lines indicating that the GM "may" award XP for roleplaying, without any further guidance, are hardly a firm support for roleplaying.
It's even more telling that the vast majority of a D&D character sheet is geared towards combat survivability. Key stats are hit points and armor class. When you're given a hammer, every problem looks like a nail. Solving problems by methods other than combat is not only poorly supported by the rules, but actively prevents the player from engaging with the core rules.
To put it more clearly, D&D is a game about resolving combat, collecting loot and avoiding traps. Roleplaying is not part of the game - it is something you do between playing the game. Its function is roughly equivalent to the chat interface in World of Warcraft.
Compare and contrast this to the World of Darkness games, where character creation is based more around how you would like to roleplay your character than it is about your combat potential, and where sinking points into acquiring unique foibles and story hooks could be just as attractive as power maximisation. Often in these games key power gains were tied to your character overcoming certain personal faults such as fears, addictions or preconceptions.
Or 7th Sea and Legend of the Five Rings, which use "drama dice" or "void points" as a reward for strong roleplaying; these tokens can be traded off to allow the player direct influence over the fate of their character and the direction of the plot. Conflict resolution mechanics are drawn directly out of the desired tone and mood of the game, so that the outcomes of die rolls naturally reinforce the implicit genre rules.
I've picked those examples because despite their roleplaying focus they're strongly built around combat and physical danger, much like D&D. But if you go further afield to titles like Primetime Adventures and Amber you'll find systems that see combat as merely a subset of conflict resolution, and conflict resolution as something that should be subservient to the core thrust of the plot. These are real roleplaying games, where the roleplaying is the main play content.
So don't tell me Dungeons & Dragons is a roleplaying game. It's not. It's an excellent tabletop tactical boardgame, which distinguishes itself from titles like Descent and Heroquest by its significant level of character customisation and its encouragement to set the combat and looting gameplay within the context of a larger narrative.
Now if you'll excuse me, I have to get back to choosing my level 3 encounter power and speculating as to what feat I'll pick up at level 4.