We know that (7,4) hamming code has 4 message bits and 7 code bits and can detect any single bit error. The (12,4) repetition code has 4 message bits and 12 code bits and can detect any single bit error. I tend to think that since in hamming code we are using less number of parity bits, there should be some disadvantage vis a vis repetition code. Is it true and if yes, what is the downside of hamming code? (One known disadvantage is that of encoding and decoding complexity.)
This is an important subject that (IMO) is poorly handled in many introductory textbooks. To start, assume that an uncoded system spends $E_b$ joules per bit and transmits at rate $R_p$ information bits per second.
How can you compare this system fairly with the Hamming (7,4) code? Making them operate at the same bit rate implies a bandwidth expansion of 7/4, which is not always possible or desirable. Making them operate at the same energy per bit means that the energy of each Hamming coded bit should be $E_c=4E_b/7$.
So, you could say: under the same bandwidth and energy constraints, the cost of using a Hamming (7,4) code is a reduction in the data rate by a factor of 7/4. The benefit is a slight reduction in bit-error probabilty (but quite a bit less than that predicted by the binary symmetric channel).
Regarding the repetition code: under the same assumptions, the repetion code has a rate reduction of a factor of 3, while offering zero gain in probability of error!
Under the assumption that $E_c=E_b$, then the repetition code has quite a bit to offer in terms of bit-error rate. However, the cost is that you're multiplying the energy consumption by 3 while reducing your data rate by 3. To be fair, you'd need to compare the repetion code with an uncoded system whose $E_b$ is also increased by a factor of 3.
To summarize: comparing codes is not trivial, but not terribly hard either, as long as you make all your assumptions clear.