Why does Plot[D[x,x],{x,1,10}] throw error? [duplicate]

I am experiencing unexpected behavior from Plot and D, and I would like to understand why. If I try this:


I get a General::ivar error, but if I do this:

f = D[x,x]


it works just fine. I come from a Python/Julia background, so I find this behavior baffling. What is going on here?