As a programmer, I often hear "writing a program" and "writing code" used interchangeably. The way I understand it, a program is a file which contains code written to perform a task or a series of tasks. Those who write computer programs (like myself) are typically referred to as programmers. However, the slogan of the popular website CodeProject is "For those who code," not "For those who program." Is there any difference in meaning between "I code for a living" and "I program for a living"?
Though some raise a distinction, there isn't a generally accepted difference between the two.
However, non-technical people may be more likely to understand what you mean if you call yourself a "programmer" rather than a "coder". The word "computer program" and "programmer" have very wide comprehension, whereas the term "code" - as a synonym for a computer program - has a narrower reach and is more easily confused with other meanings. Even worse: "hacker".
Programming encompasses coding, but coding does not encompass programming.
Programming is a blanket term for a set of activities, of which coding is one. See this explanation from WiseGeek:
"Generally, there are five basic stages of development that a computer programmer addresses in designing software. They are defining the need, designing a flowchart, coding the software, debugging and beta testing."
I would say rather that programming requires analysis, design, communication, coding, testing, and release management. A programmer not competent in at least a couple of these disciplines risks being a mere coder.
Here's how the New Hacker's Dictionary defines
A magic spell cast over a computer allowing it to turn one's input into error messages.
An exercise in experimental epistemology.
A form of art, ostensibly intended for the instruction of computers, which is nevertheless almost inevitably a failure if other programmers can't understand it.
The stuff that software writers write, either in source form or after translation by a compiler or assembler. Often used in opposition to "data", which is the stuff that code operates on. This is a mass noun, as in "How much code does it take to do a bubble sort?", or "The code is loaded at the high end of RAM." Anyone referring to software as "the software codes" is probably a newbie or a suit.
A program is something high-level, whereas code* refers to translation (e.g., English words → Morse code; C language → assembly or machine code); as the OED puts it, code is
Any system of symbols and rules for expressing information or instructions in a form usable by a computer or other machine for processing or transmitting information.
*from the Latin codex, meaning a tree trunk, book, or enumerated collection of things (e.g., legal canons)
A coder needn't be a programmer just like a telegraph operator needn't be a literary author. But programmers (those who make programs) do need to be coders (those who make code), just like literary authors need to encode their writings somehow (in the form of handwriting, typewriting, etc.).