Ideally, you should be familiar with mathematics in whatever field you find yourself in life. At least to the extent that it makes sense to you and to getting your job accomplished in a timely manner.

That can probably sum up the entire article, but that wouldn't be very fun. So let's dive a bit deeper into the concept of **math **and just how important it is, or can be, to the average programmer in this day and age.

## What is math?

Let's start here. Because I get asked the question "Do I need to know math?" more often than I'd care to realize by my programming students. My answer from above is still relevant here. Know the math required for you to function in your day to day life. If you need to divide long complex numbers every day, then, learn to divide long complex numbers. If you work with statistical data, then geometry might not be the best use of your time. Quadratic equations won't make your HTML/CSS any better either. So context is important.

The reason most people ask me that question, is because they are terrible at their idea of what math is, probably due to poor grades in school. They panic at their lack of understanding of geometric shapes and slope-intercept forms. And if building a responsive contact page requires the calculation of angles of an isosceles triangle, then forget it.

So let's get that settled. Math is different things to different people. The Greek translation of mathematics means "knowledge" or "learning" and has little to do with adding and dividing, as we make it out to be today. Physicists use math, but they rely on symbols rather than on numbers. And programmers use math as well, depending on the project at hand.

## When to be mathematical

The truth is that math is all around us (not in a deep mystical way, but kind of). For example, when a web developer designs a responsive layout with fast loading and fluid images that seem to magically resize and reshape as the browser gets smaller and smaller. There is some underlying math in that formula. There are percentages and dimensions that need to be calculated by the developer.

Your use of math in programming will come down to a few things, such as your current place of employment, the task at hand and your current knowledge of mathematical concepts.

## Web development

Web development is getting complex and it is not slowing down any time soon. And that's a good thing, and benefits everyone from the artist to the client using the website. The artist gets to express themselves in any way they wish, the developer gets the tools to accomplish this, and the user gets a better overall experience.

New additions to CSS such as the ** calc()** function let you have more control of an elements overall size and appearance, such as in the following example.

```
.banner {
position: absolute;
left: 40px;
width: calc(100% - 80px);
border: solid black 1px;
box-shadow: 1px 2px;
background-color: yellow;
padding: 6px;
text-align: center;
box-sizing: border-box;
}
```

Much of this math will come down to pretty standard arithmetic formulas dealing with addition, subtraction and multiplication.

New properties such as *transform,* let us rotate, scale, skew, or translate an element however. It modifies the coordinate space of the CSS visual formatting model. Essentially, you can modify an object's (x,y) coordinates to do various things.

And the more hardware advances and as new standards get put into place, we'll have the ability to be more mathematical in our way of thinking when designing and developing websites.

## Game development

Game developers working on physics and game engines rely heavily on mathematical principles in order to make their magic happen. A single virtual bullet in any shooting game has to follow some form of natural law. While it can be dumbed down in a game, to some extent, it still must rely on a system. It needs an initial velocity, a direction, acceleration, deceleration, etc. However, game developers working on rendering tools, probably require a totally different kind of math to do their job. They need to focus more on angles and geometric shapes as well as lighting and shading.

If you are working on a 2D side-scroller even, then you must follow 2D physical laws. You would have to begin to think in a 2D kind of way. How is a 2D jump different from a 3D jump? How far can projectiles fly across the screen before they no longer exists. How do we scale down the background so that our characters look like they are in a real- world, and not in some bizarre environment.

Having said that, math is only one element of game development. There are still non-mathematical concepts in involved, such as the actual game logic, creating menu's, battle systems, etc.

## Payment processing

If you have been a web developer for any part of the last 5 years, then you probably have had to implement some form of payment platform. You had to calculate tax-rates, sub-totals and totals. Coupon codes might be a thing for you as well. Coupon may seem trivial when you are just simply using them, but they can grow in complexity pretty quickly when programming that money-saving logic.

Your level of mathematical knowledge here really will depend on the complexity of the financial system that you are working with. Different companies have different rules and sales models, and more so than knowing "math", you will want to be more familiar with that particular companies models.

I used to work for a magazine publisher, for example. And their sales system was entirely custom built and their math proved it. Ordering a subscription was not as simple as "I want this, I pay this". It involved some strict time-based calculations, a few pro-rated refunds and some carry-over logic.

But underlying that entire system, we still have standard mathematical concepts. We are still adding together numbers and dividing by others, and not calculating what happens at the event-horizon of a black hole.

## So...

So do you need to be good at math in order to be programmer? Well, based on the list above, it would definitely help more than hurt. It will give you more tools to add to your coding arsenal. It might even spark your creativity and take it to new levels. Something that you thought impossible yesterday, suddenly becomes possible with just a few lines of code. But that's true with any skill. Become better at art, at business, at photography. All of these things will help you out as well. Don't just pick one subject which you dislike, and use that as an excuse to not pursue something that you might end up loving.

Having said that, don't go and take math classes at your local college in preparation to becoming a programmer either. Become a programmer that isn't very good at math to start. Maybe you don't use animations or transformations and interpolations day 1 on the job. Maybe your work is pretty static and doesn't spin around at various degrees. Maybe you are just starting out, and still excited about learning new concepts every day. That's 100% just fine.

The mathematical concepts will always be there waiting for you to see them. They aren't in a rush and neither should you be. Take your time and enjoy the 'not-knowing' of it all. Because once you know it, the mystery ends and with it that excitement of uncovering it as well.

Comments