Math In Programming – Do You Really Need It?

When ten years ago someone asked me “what do you want to do when you grow up?” I answered, “I wanna be an IT guy”. Then the person asked another question: “do you know that you will have to learn and understand Math?”. I answered yes and kept this in my mind for the next ten years.

Yet another common dialogue:
A: “What do you do for the living?”
B: “I’m a software developer.”
A: “Great, so you have to be good at Math.”
You all have had this kind of dialogues and have heard these questions hundreds of times.

Math seems to be strongly related to programming. Is every programmer a mathematical genius? Do you have Math books on your desks? Do you use all the complicated formulas and thesis? The answer is “no”. Then someone may say “so Math is not important for programmers, right?”. The only right answer is, as always, “it depends”.

All depends on the specialization you have chosen. In this post, I’ll take a look at Math in the most popular fields: back-end, front-end, data science and games development.

Benefits

Before deconstructing the problem per specialization, let’s take a minute to think about the universal benefits of being fluent in Math. They all are essential for the people who are or aspire to be programmers.

First of all, solving problems. When calculating all these long equations, you learn how to deal with complicated queries. You learn that you should try to go in many directions; you also learn to be skeptical about your ideas.
Math shows you that sometimes trial and error method is not a good idea. Moreover, to solve a problem, you have to think logically, so that you find a solution faster. These skills are useful in coding. If you have no idea how to implement a particular part of the application, you decompose it into smaller parts, solve them and then wire all the solutions together. You also learn how to work with patterns – you are more fluent at recognizing and applying them to the problem.

Secondly, looking for mistakes. This point is related to the previous one. You know that you solved an equation with a proper method, but the result is not equal to expected. You start looking for the mistake by going step by step and checking everything. Sometimes even performing “2 + 2” on the calculator to be sure that it is equal to 4. This process is very similar to debugging – you try to spot a mistake, ensuring that the most trivial things work as expected.

The last thing is abstract thinking. Math forces you to think in abstract terms. You have to be imaginative. There are things that you cannot touch and feel. Everything is on the paper or in your head. Abstract thinking is useful when designing the next layers of your application or describing the way how components interact with each other. Surprisingly, I found it very helpful when designing systems with many related components – microservices, databases, virtual machines, Docker containers, APIs, and so on.

In my opinion, solving problems, chasing errors and abstract thinking are the skills that are crucial for every developer. How to learn them? Learn Math.

Let’s start discussing the most popular specializations for developers.

Backend

A backend developer is a developer that is involved in implementing a domain of a given problem on the server side. If the application is not related to calculating statistics, dealing with money and other financial stuff, then there is not much space for Math.

Backend developers should be fluent in algorithms and their computational complexity. To understand them better some fluency in Math is required. The most common algorithms use many assumptions and properties so that they are more straightforward and efficient.

There is one more thing I see Math required — application’s performance. You should know how to analyze statistics, charts, and logs. You should be able to find more effective solutions that consume less memory or CPU. If you want to implement any shortcuts, you should understand them and prove that they work in every possible case.

Frontend

Frontend developers are responsible for what the end user sees. They build user interfaces. The majority of their tasks does not require any Mathematics knowledge. However, they deal with screen sizes, ratios, percentages, time and progress bars. All these elements involve some mathematics.

One thing worth noting is that they may spot the same performance problems as backend developers do.

Game development

The third common path for developers is game development. This path requires substantial knowledge of mathematics.

Linear algebra, vector Math, quaternion, combinatorics, statistics – all are critical for learning and working in game development. As far as I know, some environments have all the Math and physics implemented. Does it mean that you may ignore mathematics? No, for sure not. I think that you should know the basics on which all these things are built.
It is crucial to understand what is going on under many layers of abstraction when working on more efficient approaches.

Artificial Intelligence, Machine Learning, and Data Science

This path of developers career has become more popular in recent years.

All the AI/ML/DS is about Math. On the lowest layers, there are implementations of formulas describing all this magic. If you open a random paper on Arxiv, you see huge equations and complicated words.

Again, all the frameworks and environments hide everything under layers of abstractions. They wire and compute everything, but it doesn’t mean that you can develop applications mindlessly. You should know why and what kind of algorithms perform better for a given problem. You have to understand the differences between the used methods. Finally, you should have a feeling why a given algorithm does not work.

Since I have tried developing ML models, I would say that in this field Math knowledge (or will and skills to learning) is mandatory. Without it, you spend hours analyzing what authors of a paper meant. They use many shortcuts that should be obvious to the reader.

Summary

Summing up, everything depends on what part of the world you are implementing. Some domains are more demanding than others. In my opinion, it is essential to know some aspects of Math or, at least, spend some time trying to understand and learn it.

Is Math required to work as a developer? No, it is NOT. Is Math important in daily work? Yes, it is essential.

Of course, this is only mine point of view. I haven’t been working in all these fields, so my experience is limited. Please feel free to share with us your experience on this topic.

You may also like

Comments