Comments

Do You Have to be Good at Math to be a Good Programmer?

“If you’re good in math, you’ll be a good programmer.”

FALSE!

I’ve seen this argument too many times and I’m tired of it. So let me share my views about this and explain why I think this argument misses the mark.

The inspiration for this post was a thread in one of Facebook groups. A proud programmer commented:

“Can you make a high-level calculation engine with machine learning in C++? Remember, because you can create simple web applications, doesn’t mean you’re a high-end programmer.”

This argument doesn’t take into account how diverse the world of programming is. Not every application is about machine learning and AI. Besides, if there is an element of machine learning involved, it doesn’t mean one has to be a math genius to build an application that uses some sort of machine learning.

My second issue is with the definition of a “high-end programmer.” What makes a high-end programmer? Do we have an official definition written and stamped by super-advanced aliens?

In my personal experience, people who define programmers in this manner tend to be classists: people who like to feel superior to others for knowing some math. This is also an ignorance to the diversity of experience within the world of programming.

Who is a good programmer?

Here’s my personal definition of a good programmer.

A good programmer is one who

  • solves today’s problems in the best possible way (not future problems that may never happen)
  • is passionate about learning new things
  • is familiar with a range of languages, tools, and best practices
  • uses the right language/tool for the right problem
  • writes clean and maintainable code that people can understand
  • accompanies their code with a suite of unit tests
  • considers the balance of performance, scalability, security, maintainability, and extensibility
  • is a good team player and communicator
  • delivers working software in time

Do any of these have a root in this?

ei∏+1=0

Programming is a creative activity. It requires thoughtfulness, discipline, determination, and curiosity.

Math and Programming

I studied math at university, learning how to calculate the intersection of a cube with a sphere in a three-dimensional space. We learned a lot about limits, integrals, differentials, etc. in high school. But in the end, it’s all about memorizing a lot of formulas that are rarely used, let alone remembered. None of this taught me how to be a good programmer.

Math does help develop problem-solving and analytical skills. I don’t disagree with that. But I also believe that the human brain is way more complicated than what we understand, and math is not the only way to develop analytical skills.

Just because one knows how to solve complex math problems doesn’t mean they know how to solve a programming problem with clean, maintainable code and deliver working software on time.

I’ve been in the programming industry for nearly two decades and I’ve seen programmers who excel in math but they cannot deliver a simple application on time. They write messy and unmaintainable code.

Does math make you more intelligent?

There is also this other misconception that being good at math makes one more intelligent. By this rationale, are medical doctors or lawyers less intelligent because they don’t use math?

Let’s stop being so arrogant about what we know and can do that others can’t.

There are people who do extraordinary things in the world and they don’t know math. They’re excellent problem solvers, they’re very analytical and can solve today’s problems with excellence and on time. They’re not less intelligent than you, my arrogant friend.

Programming in the old days

In programming, we have this concept called “level/layer of abstraction”. Programming started with 0s and 1s. After several years, the assembly language came out and it allowed us to write programs in a more expressive way than using a bunch of 0s and 1s. A few years later, C came out, which added a layer of abstraction over Assembly. The same pattern has repeated over and over.

While the very base of programming is 0s, 1s, and logical circuits, it doesn’t mean one has to know all of that to be a good programmer today. No one has the time to learn all of that.

Today, for the most part, we’re programming at a higher level of abstraction.

Back in the 90s, we used to write low-level code with C to transfer some data from one computer to another. We had to open a TCP connection, buffer data, deal with various error codes, and close the connection.

Modern day programming

ES10

These days, you don’t need to understand how TCP works to send a push notification to one’s mobile. If you really think you need to know that or knowing that makes you a better developer, you better go back and learn the assembly language as well as the architecture of CPUs, logical circuits, etc.

By the same token, we write queries to get data from a database. We’re programming at a higher level of abstraction. We don’t need to know exactly how the data in a file is structured or even implement a database using C just to query a database properly. In fact, you may be able to implement a database in C, but you won’t have a clue about the optimization techniques of database queries or structuring data for security or scalability. These are entirely different skills.

In my view, programming languages evolve like living organisms. Life started with single-cell organisms and after millions of years of evolution, now we are complex organisms with a trillion cells. You don’t need to understand how a cell works to learn to eat a healthy diet. Think of it at a higher level. You think about eating greens, proteins, avoiding fried food, etc.

What Every Programmer Must Learn

Although math is important and has been used in the design of computers, not every kind of programmer today needs to be great at math.  Unless you are building an application that involves a ton of image, video or audio processing, you don’t need to know math at all! Let me explain why that’s the case.

Math is great, but it is not an essential skill for the modern day programmer.

The modern day programmer needs to be good at one or two programing languages, be proficient with their data structures, design patterns and databases. This is the typical stack of knowledge that they need to have, to be a good programmer. In addition to this, programmers also use a wide variety of tools to make their lives easier. Tools for source control management like Git, IDEs like visual studio and so on. These are the skills that programmers need to learn to be successful at work everyday as a software developer. They have to know the best design patterns to fit their requirement, they need to know which data structure to use when and so on. The knowledge about the overall architecture of their codebase, tools, and technologies is what helps them be successful at work.

You can clearly see here, that complex calculus problems doesn’t teach you any of these skills that we discussed. Complex math problems don’t help the programmer learn faster either.

Math Problem vs. Programming Problem

A popular interview question at companies like Google and Amazon is finding the first non-repeating character in a string. No one does this in the real world. But knowing how to solve this programming problem is far more effective in training people’s programming brain than calculating the intersection of a cube and a sphere.

Speaking of algorithms, the performance complexity of an algorithm touches on logarithmic, linear and exponential curves. One doesn’t need to know how to solve a logarithm problem in order to understand the performance complexity of an algorithm. All they need to understand is the difference between a linear and logarithmic curve, and even a high school student can understand that.

The Bottom Line

Have respect for others and don’t insult their intelligence or capability because you do certain things that they don’t or they can’t. They sure can do things that you, with all your math skills, can never do in a lifetime. Don’t be ignorant of that.

The more you learn, the more you realize how much you don’t know. In my language, Persian, we have a saying:

The more fruits a tree has, the more it leans down.

Programmers who think they know it all just because they know some math is an example of a fruitless tree.

Remember: there is not a single recipe for a meal, nor is there a single recipe to become an outstanding programmer or successful in life.

Hi! My name is Mosh Hamedani. I’m a software engineer with two decades of experience and I’ve taught over three million people how to code or how to become professional software engineers through my YouTube channel and online courses. It’s my mission to make software engineering accessible to everyone.
Tags: , ,

9 responses to “Do You Have to be Good at Math to be a Good Programmer?”

  1. Thanks Mosh for writing this good article
    I am inspired by this article

  2. Ahmad Kelany says:

    Thanks for the great article,
    I have been coding for a long time, and I have many professional projects under my belt, but recently in an effort to explore more, I joined a site that offers daily programming challenges, and whenever math is involved, I fare poorly.. to the point I started questioning myself as a programmer..

    Your article here convinced me that I don’t need to be a math guru and dedicate a lot of my time to learn about stuff that I might never need outside the challenges.

    Thanks a lot.

  3. andromadus says:

    Awesome. Thank you, sir. This is a good read. I feel inspired…

  4. Branislav Petrović says:

    Great article written in down to earth style, especially useful for those who are new to programming.

    Thanks Mosh!

  5. Chris says:

    From the article since I don’t know if this comment system supports markup:

    “Just because one knows how to solve complex math problems doesn’t mean they know how to solve a programming problem with clean, maintainable code and deliver working software on time.”

    Before I even read the article this summed up my view on the matter. This is an entirely different skill.

    Even a fresh grad can write pretty much any program that a modern business requires given enough time, but it takes experience to write something that is maintainable, can scale to thousands of users, and is relatively error free. This doesn’t even get into the many architectural and design decisions that they don’t teach you about in school.

    I’m not really sure what a “high-level calculation engine” is, but that comment reeks of someone who is full of themselves. I feel sorry for anyone who has to work under this person.

  6. kubila says:

    It was a good reading, there is no single truth, Thanks for the article Mosh.

  7. ndifonluke says:

    This article is realy inspiring Sir. Thanks for the fine distinction which you made between programming and maths.

  8. maedeh pr says:

    that was great

  9. naser says:

    thanks. this article was very helpful.

Leave a Reply

Connect with Me
  • Categories
  • Popular Posts