HACKER Q&A
📣 matnar

Is learning math useful to be a good computer scientist?


A few days ago, I read that math is not that much important of you want to be a computer scientist.

I read this sentence as a provocation and caught me so much that I'm still thinking about it.

I studied math and computer science and I strongly believe that having a math background helps you a lot to reason about a problem and formalize the solution. I do believe math can help you to implement some clean code, e.g., that solves a problem without a bunch of if else statements (or to identify state machines where they are not so easily spotted).

In my experience, math helped me a lot, even though so far I never implemented compilers, interpreters or defined new languages (tasks where most of scientists agree that having a math background helps).

What do you think: is learning math useful to be a good computer scientist?


  👤 Jtsummers Accepted Answer ✓
To be a good computer scientist, math is critical. If the writer meant programmer, then it's more debatable. Some of the best programmers I've known have been perfectly mediocre and even bad at math. However, that also cut off large categories of programs from them. Or, they could do it but it was more as a plumber or applying ideas rather blindly, or getting someone to explain it in enough detail that they could code it (guided, but still no real understanding).

But computer science isn't (just) programming. Many areas of discrete mathematics are highly applicable to the field of CS. Particularly number theory, graph theory, probability, combinatorics, logic, and set theory. And those are just the discrete math topics I've used in my own career (which isn't that long, approaching 15 professional years).

Algebra, calculus, linear algebra, and trigonometry have also been part of my work, though that's been more as a programmer than as a computer scientist (translating mathematical formulas and such into code).


👤 onion2k
It's critical. You can't do computer science without understanding math.

However, it's also important to note that the overwhelming majority of developers are not computer scientists. You don't need particularly good math skills to write software. Most developers aren't doing things like implementing compilers, interpreters or defining new languages. If your job is essentially taking input events, figuring out what they mean, putting the result in a database, and then pulling the data out and displaying it in a specific format on request, then you can get away with very little math at all.


👤 spoiler
I saw a lot of people talking about programer/developer vs computer scientists. I just wanted to add to that that CS/maths doesn't make you a good engineer either.

Some of the smartest computer scientists I know are just horrendous engineers (what's worse a lot of them lack awareness and have big egos and insecurities to boot). They seem to see code as a means to an end, and they only know how to think in terms of some primitives, and lack the ability to think in bigger pictures.

On the other hand one of the best engineers was one who didn't study math or computer science in his career. He designs elegant/simple systems that have maintainability and DX baked into them.

Of course this isn't a rule, just anegdota.


👤 Isinlor
Is learning whole encyclopedia and 10 natural languages useful to be a good computer scientist?

Yes, of course! Is it the best way to spend your time having the goal in mind? Maybe not.

The issue with "learning math" is that there is more math being created than you are able to learn.

"a good computer scientist" is very broad.

Does it mean "a good 3D engines programmer" - then probably you want to know linear algebra, things like quaternions etc.

Does it mean "a good browser front end developer" - then probably you want to invest your time somewhere else, maybe web design, learning how to sketch.


👤 aristofun
Math is useful to be a good "anybody".

Even if you don't apply math knowledge directly in your profession — this is one of the best way known to humanity of teaching your brain abstract thinking, logic and reasoning.

And CS is the field where those 3 things are the core of profession.


👤 globular-toast
What is "maths"?

At least four things come to mind:

(1) Basic ability with arithmetic and algebra (simplifying equations etc.),

(2) Gifted with numbers; ability to do calculations quickly in the head, strong intuition etc.,

(3) Fluency in the language of mathematics; ability to communicate with other mathematicians and evaluate literature for new results,

(4) Creative ability required to produce proofs of new results.

A mathematician is primarily concerned with (4). This almost certainly requires good grasp of (1) and (3) as well and possibly (2) as well.

A computer scientist in the academic sense is actually a mathematician, so it's the same.

A programmer is where it becomes more fuzzy. I can say with certainty that (4) is not necessary, but I think (1) is necessary. I mean, I don't think anyone seriously believes a programmer doesn't have a basic "high school" ability with numbers do they? As for (2) and (3), no I think it's clearly not necessary, but it's definitely useful, and in some ways inevitable, depending on which area you go into.

There is also some extension of (1) that is particularly useful for programmers. Obvious examples are Boolean algebra, discrete maths (like modular arithmetic) and base systems (binary numbers). It's all useful. Not necessarily every day, but it's inevitable that they will become useful eventually (or you will have to learn them).


👤 chris_j
Define "computer scientist". Computer science is a big field but those parts of computer science that I have learned have been heavily underpinned by mathematics, especially those parts concerned with analysing the correctness and complexity of algorithms.

Having said that, I personally waved goodbye to academic computer science after I finished my degree. I work as a software engineer and I find software engineering to be very different discipline to computer science. While mathematics has proven useful to me on occasion, I'm of the opinion that I'd be able to do much of what I do day to day without much in the way of advanced mathematics. Much, but not all. When one encounters certain types of problems, for example problems around performance, I find it helpful to be at least _acquainted_ with mathematical tools that can help, even if my mathematical chops are not as strong as they used to be.


👤 adrianN
Computer Science is a very wide field. You can be a successful Computer Scientists with very little math background. For example you can invent new network protocols without too much math. If on the other hand you want to invent new approaches for solving Linear Programs, you'd better be very good at linear algebra.

👤 sugarkjube
There's a new video on the math channel numberphile "math is all about shortcuts". Imho that sums it up.

A lot of "skills" talk seems to be oriented towards justifying hiring underskilled people in IT, that's probably where this also is coming from, more HR babble than anything else.


👤 teh_infallible
As a mostly self-taught programmer without a CS degree, I think your math skills put you in a league above me. I decided to take a shot at learning linear algebra a year ago, and was pleasantly surprised to see that “vectors” are basically “arrays” as I know them from Ruby.

👤 bayesian_horse
Learning math is useful to become a better Human.

👤 giantg2
"Is learning math useful to be a good computer scientist?"

If you work at science, engineering, or other intensive industry - sure.

If you're like 75%+ of developers that work at some boring company doing CRUD - no.


👤 mingusrude
Another way of looking at it is that later in you career it seems to be a lot easier to pick up CS concepts while it's a lot harder to pick up math if you don't have it from the start.

👤 astrophysics
Math can be a superpower for developers.

👤 anfelor
I did math in undergrad and I am now going the computer science PhD route. I think basic math really helps and some fields like combinatorial optimizations are good as well, but most of mathematics is only useful for pure mathematicians and physicists. Except for niche fields like topological data analysis, I have yet to see any application of homological algebra, algebraic geometry or PDEs in computer science.

👤 sidcool
Yes. Especially if it's theoretical computer science. Computer science is but a branch of mathematics.

👤 bwh2
Reading Coders at Work surprised me because this question was explicitly asked and each person interviewed basically said math is not very important, that the ability to write prose is more important.

👤 fooker
There is not a lot of math involved in working on compilers and programming languages (My PhD was on compilers).

Sure there is some, but it is all easily learned on a case by case basis without a heavy math background.


👤 f6v
Is math useful for computer science? Absolutely. For developing websites or apps in a sweatshop or your “Next big thing” startup? I’ve seen many people who got by without it.

👤 UK-Al05
Not essential for large chunks of business software.

But math can open up lots of new domains for programming, and extend your abilities.

I'd argue you're pretty limited to boring software without it.


👤 Tempest1981
How about puzzle solving? I've been asked this:

If you enjoy solving puzzles, might that indicate you'll enjoy programming?


👤 amelius
Math is huge. Perhaps the author could summarize which branches of math have been most useful to them.

👤 tablespoon
Math is the language of the universe, so it's always useful.

👤 bawolff
Wanna solve P=NP? Math is important.

Wanna make some react app look pretty? Not so much.


👤 foxfluff
What kind of math do you use to identify state machines?

👤 otabdeveloper4
> Is learning engineering useful to be a good civil engineer?

👤 bjourne
Yes!!!

👤 yonisto
Yes