Coding is merely that: The act of writing code. It can be with any purpose.
According to Eric Raymond, a hacker is anyone wanting to create and/or subvert how things are usually done in their field or whatever they're doing right now, in ways that improve the process for everyone. This means that not every coder is a hacker and viceversa.
As for the media, a hacker is anyone violating the security measures put in place in any software system. They can be hackers, such as the guys who did it to improve the security settings in ten thousand routers; but, more often than not, they are to be called crackers (according to ESR anyway).