1) In programming, code (noun) is a term used for both the statements written in a particular programming language - the source code , and a term for the source code after it has been processed by a compiler and made ready to run in the computer - the object code .
To code (verb) is to write programming statements - that is, to write the source code for a program.
2) In cryptography, code has both a specific technical meaning and a general meaning. In the technical sense, code is the substitution of one word or phrase by another word, number, or symbol for the purpose of concealing the original word or phrase. Basically, it's substitution at the word or phrase level. In industry, a developing product is sometimes given a code name to conceal its probable marketing name. Historically, military operations have often had a code name while in the preparation stage. In World War Two, Germany's invasion of the Soviet Union was given the code name of Barbarossa. Code in this sense is sometimes confused with a cipher , which is substitution of symbols at the letter level. Modern cryptography is much more concerned with ciphers than with code in its limited technical meaning.
Code is often used generally to mean any kind of concealed writing, including ciphers. "Breaking the code" usually means the discovery of a way to read one or a series of encrypted messages without being given the key to decrypt them.