In short, coding is not more complicated than math. Math generally involves reasoning about a problem to generate a solution, e.g. given (x) show (y) is true.
Coding typically involves writing down the solution in computer-readable format, e.g. writing code in Python to generate the area of a square.
This is not to say that all coding is more straightforward than all math. There are easy problems in math, and there are complicated problems in coding.
For example, simple arithmetic in math is very easy, whereas coding a nested loop to iterate a linked list while maintaining a moving head pointer can be difficult.
To gain a better understanding of why math is considered more difficult than coding, we need to look at the different types of math and the different types of coding.
We also need to get an understanding of what math and coding are.
What is math?
Math is a science and a language. As a language, math helps people discuss complex topics about our world. Just as English helps English speakers communicate with each other, math symbols and equations help to communicate math concepts with others.
What is coding?
Coding is the part of computer programming (or software engineering) where a person (or maybe some AI, see GitHub co-pilot) writes code in a specific language that a compiler or interpreter can understand to turn into some machine-readable format.
In essence, coding is just one component of a computer programmer’s job description. The act of coding represents writing out the instructions for the computer to work with.
Coding vs Programming
Programming is quite a bit different from coding. Programming refers to the entire task set of a computer programmer/software engineer.
Where coding is the act of writing code, programming is defining how that code should be implemented. For example, if you were building a website, you could be coding the front-end of the site but programming that front end into a build process that has automated testing, is stored in some form of a source code repository, deployed across many instances on virtual machines or in a Kubernetes cluster.
It is easy to think of programming as designing, building, testing and deploying an application.
What are the different types of math?
The most common branches of math are:
- Algebra
- Geometry
- Number Theory
- Arithmetic
Based on the above branches, many other subdisciplines in math have been discovered.
Each of these disciplines has concepts ranging from very easy to very hard.
Different Types of Coding
Coding can be done in a variety of programming languages. Programming languages are text-based or graphical-based ways of writing computer programs. These languages can be categorised in several ways.
One category is high or low-level. This level is just a way of saying how far away from machine code the language elements are. So a high-level language will read more like a spoken language like English, for instance, and a low-level language will mirror more machine-code-like instructions.
An example of a low-level language is Assembly, or even C/C++ nowadays due to the lack of automatic memory management.
Another category is the programming paradigm on which the language is generally used. Possibly, the two most favoured paradigms in current technology are object-oriented programming and functional programming.
There are a lot of other programming paradigms. Still, the most used languages, like Java and C#, generally are used in an object-oriented fashion, whereas Javascript, Haskell, F# and others are functional programming languages.
It is important to note that many languages above have ways of being either object-oriented or functional depending on how the coder wants to implement the code.
Can coding be hard?
Coding can be quite difficult. For most problems that need to be coded, simple, straightforward code is usually possible. Once you start needing to handle memory management, processing speed, thread management or managing physical resources, coding can become quite tricky.
In most cases, you can break down the problem solved into smaller code blocks. These smaller code blocks can be easier for the coder to reason about and work with. This ability to break down what you are coding into smaller chunks is not something that can always be done when working on math problems.
Is math required for coding?
Most coding tasks require little to no maths. For example, if you have simple arithmetic knowledge, you can easily code software that calculates totals, medians, means etc…
Even front-end development typically only requires you to be able to tell a position in some coordinate system or whether there is space to put an element to give a specific media size.
However, if you are considering working in game development or some AI/machine learning environment, then you would certainly need to be working with above-average math skills.
Game development will often require modelling in three dimensions, creating physics for how characters and objects move and dealing with collisions. Add to this dealing with light, reflections, refractions etc… and the math could become quite tricky pretty quickly.
Computational complexity and algorithm design
When coding, a programmer/developer needs to understand computational complexity. This is just a fancy way of saying that a programmer needs to understand if the code they are writing will be reasonably efficient.
For example, if you were to write a function that calculated the number of each letter in the alphabet that existed in some array, you could loop through the array once and keep a running total of all the letters (using a hash table or some other construct). Or, you could loop through the array looking for the letter A, then loop again looking for B and so on.
The first method only loops through the array one time. The second method will loop twenty-six times. So the first method will run more efficiently than the second.
The above example deals with time complexity, but there is also the concept of space complexity. Space complexity is just being aware of the number of resources your algorithm will take to run.
Time and space complexity knowledge, and the basic level of math required to calculate these, should be a minimum amount of math required for coding.
Conclusion
Some code requires almost no math, while others require a lot of math. To determine if coding is harder than math requires an understanding of the problem that you are trying to solve.
In general, math is more difficult than coding due to the nature of having to prove theorems and concepts. Coding is more black and white and can be completed in many ways with varying levels of efficiency and correctness. Whereas math requires complete correctness in most cases.