Updated: Feb 19
It is common today to hear the terms 'coding' and 'computer science' used interchangeably, which leads people to believe they mean the same thing. They are related, but pretty different and should not be confused with each other. Computer science involves coding, but coding does not always involve computer science. I've heard it said that computer science is what you pay to learn and coding is what you get paid to do. If a child enjoys or excels at computer programming, they may think that they want to continue pursuing and studying coding in college. However, coding is not a major or degree program, and people interested in coding can sign up for Computer Science degrees and have the opportunity to do a lot of coding.
Coding, or computer programming, is the act of writing instructions for a computer to execute. Coding requires knowing the rules of a programming language and writing code, or instructions, in that language, in order to solve a problem. Why should kids and adults learn to code? Because it's fun and helpful to expand the way we think, similar to learning a foreign language. Coding is very practical and a useful skill to learn.
Computer science, in contrast, is a mathematical science and deals with the theoretical foundations of information and computation. Computer science is theoretical and was around before computers were created. It involves the study of compilers and architecture, operating systems, number systems, algorithms and algorithmic efficiency. If you are wondering why coding using a specific approach is faster than a different approach, computer science can explain that. You don't need a computer science degree to be a programmer, but a programmer with a CS background will have a better understanding of the behavior of computer programs.
In summary, people use these two terms interchangeably but it's helpful to understand that coding and computer science are different and to identify which term is most appropriate for the author/writer in their context. Studying a subject in college? Computer Science. Learning the rules of a language? Could be either. Learning a sorting algorithm? Probably Computer Science unless you are just sorting for fun. Taking a test? Could be for a coding interview or for Computer Science. Note that a Computer Science degree always requires coding, and that is why any of these actions could involve the Computer Science discipline. Coding is learned in Computer Science classes, but it can be learned outside of class too. The simplest way to think of the difference is coding is a hobby, interest, and activity, whereas computer science is a science and field of study to understand the mathematics and principles behind coding.