Does the definition of linear code implies that $E(c_1 + c_2) = E(c_1) + E(c_2)$ for encoding function $E$? I know that if $c_1$ and $c_2$ are two codewords in a linear binary code $C$, then $c_1 + c_2$ is also in $C$. 
However, does the definition of linear (binary) code (as a subspace of $\mathbb{F}_2^{n}$) implies that $E(c_1 + c_2) = E(c_1) + E(c_2)$, where $E$ is some encoding function?
Since Hamming code uses a generator matrix $G$ to generate code, it satisfies $G(c_1 + c_2) = G(c_1) + G(c_2)$. Is this valid for all linear codes? Or, are there linear codes that do not satisfy $E(c_1 + c_2) = E(c_1) + E(c_2)$ for encoding functions $E$?
 A: I am satisfied with definition 8 given in the lecture note by Venkatesan Guruswami mentioned by @Clement C. in a comment. It claims that a linear code has a linear transformation for encoding.

Definition 8 (Generator matrix and encoding) Let $C \subseteq \mathbb{F}_q^n$ be a linear code of dimension $k$. A matrix $G \in \mathbb{F}_q^{n×k}$ is said to be a generator matrix for $C$ if its $k$ columns span $C$.The generator matrix $G$ provides a way to encode a message $x \in \mathbb{F}_q^k$ (thought of as a column vector) as the codeword $Gx \in C \subseteq \mathbb{F}_q^n$. Thus a linear code has an encoding map $E : \mathbb{F}_q^k \to \mathbb{F}_q^n$ which is a linear transformation $x \to Gx$.

A: No, that is not implied by the definition of a linear code. The definition of a linear code is not related to the encoding function, only with the (unmapped) set of codewords. 

A block code of lenght $n$ and $2^k$ codewords is called a linear
  $(n,k)$ code if and only if its $2^k$ codewords form a $k$-dimensional subspace of the vector space of all the $n$-tuples over
  the field $GF(2)$

(Definition of binary linear codes from Lin & Costello):
So, strictly speaking, it can well happen for a linear code that $E(c_1 +c_2) \ne E(c_1) + E(c_2)$. 
For example:
$$c_1: 00 \to 100$$
$$c_2: 01 \to 110$$
$$c_3: 10 \to 010$$
$$c_4: 11 \to 000$$
This is a linear code (the codewords form a linear subspace), but the encoding function is not: $E(c_1+c_2)=E(c_2) \ne E(c_1) + E(c_2)$
However, it's easy to show that given a set of codewords that form a subspace (which is to say, given a linear code), an encoding function can be used that is also linear (and which can be expressed as a generator matrix, which is multiplied by the input).  And, in practice, that's always preferred.
(Incidentally, that's also why every "real" linear code maps the zero input to the zero codeword - a property that is not strictly required for having a linear code, but for having a linear encoding function).
