News for hackers. Stuff that matters.
Re:Ask HN: What are some important math topics every program... by Someone1234 on Thursday June 04, 2015 @12:29PM (#9660325)
Every programmer should know? None.

Middle school maths is "good enough" for the majority of programming jobs (85%+). There are of course niche programming jobs in: finance, statistics, AI, CS, gamedev, and so on but if you look at the programming industry as a whole those jobs are a tiny proportion overall (the majority are "boring" enterprise-style developers and web-developers: Java/Tomcat, ASP.net/MVC, PHP, RoR, and so on).

The thing is that the "boring"/average programming jobs are the silent majority. You'll likely read in this thread tons of obscure topics and how they apply to obscure jobs, but the reality is that few programmers work in those industries, but nobody [else] is going to post just to admit that for their job they don't need any maths day to day because it is boring and redundant.

This is JUST my opinion, but if you want to learn obscure topics, you're better off spending time learning CS topics (e.g. floating point number representation/bugs/limitations, encryption/hashing/etc, binary representations, assembly, kernel inner workings, CPU inner workings, and even borderline electronics). While advanced maths has a place in some jobs, advanced CS topics seem to be useful even on the web-stack/enterprise-stack to understand where bottlenecks might be materialising.

Maths is not useless. But most programmers won't use a lot of it day to day, if for no other reason that they have a library which does it for them (and they'd be foolish to reinvent the wheel).

Re:Ask HN: What are some important math topics every program... by rickhanlonii on Thursday June 04, 2015 @05:54PM (#9662390)
Every good programmer should know? At least abstract Algebra.

The thing about advanced maths is that it forces you to think about abstractions in ways that not even programming forces you to think. You can get pretty far programming without much abstraction, but you can't understand the mathematical fact that any group of order four is either cyclic or isomorphic to the Klein-four group[1] without thinking in a really abstract way. The more you study these abstractions in advanced maths, the better you get at thinking in an abstraction-first way.

A great book that just came out this year explains this really well by taking you from a basic algorithm to an abstract implementation, explaining the maths along the way (from multiplication to abstract algebra and number theory). It's titled From Mathematics to Generic Programming and I recommend it to anyone who wants to understand more of what I mean[2].

--

[1]: http://math.stackexchange.com/questions/165341/any-group-of-...

[2]: http://www.amazon.com/Mathematics-Generic-Programming-Alexan...

Re:Ask HN: What are some important math topics every program... by j2kun on Thursday June 04, 2015 @06:32PM (#9662618)
There are many ways to learn about abstraction, and abstract algebra is not the only one. I.e., assorted facts about groups are mostly irrelevant, and if you can learn how to think abstractly by studying, say, graph theory, why would you need abstract algebra?
Re:Ask HN: What are some important math topics every program... by insoluble on Monday June 15, 2015 @07:04PM (#9722744)
I completely agree. Logic or philosophy can help one to practice complex abstraction. Even the study of law (as in legal code) or religion involves abstract thinking.
Re:Ask HN: What are some important math topics every program... by baby on Thursday June 04, 2015 @05:37PM (#9662281)
I like this answer. But I also think that if you want to be a great programmer, knowing some math will help you tackle great problems.

For example reddit upvoting/downvoting system can't sort posts by (number of upvotes)/(number of downvotes) because new posts with just a few upvotes would get sorted on top. It can't sort posts by (number of upvotes) - (number of downvotes) because then only old posts would get in the frontpage.

You can try to hack your way through a better solution (and I believe that's what HN did with a dumb "gravity" system where time makes posts lose points). But the clever solution here is to use Confidence Intervals[1]. You choose a margin of error and you enter the values in the formula and tadaaa! You don't even have to comprehend every part of the concept here, but knowing that it exists already helps you creating better code.

[1]: http://en.wikipedia.org/wiki/Confidence_interval

Re:Ask HN: What are some important math topics every program... by fweespeech on Thursday June 04, 2015 @04:33PM (#9661862)
I'd say its really high school math. There are a number of concepts I use from 9th-12th grade math on a regular basis [e.g. DeMorgan's laws was in 12th grade iirc, most of the Algebra I use was also from 9th-10th grade] and I'm not in any of the niches you mentioned or any of the niches I'd consider "math heavy".

I'd agree that college math is really only relevant to specific niches in the industry but I think the niches are larger than you mentioned. [e.g. Distributed systems, flight guidance]

Re:Ask HN: What are some important math topics every program... by cortesoft on Thursday June 04, 2015 @04:57PM (#9661994)
I think you might be using more math than you realize. You might not have LEARNED about it in a math class, but it is math. Set theory, statistics, etc.... I know a lot of what I do involves those things.
Re:Ask HN: What are some important math topics every program... by j2kun on Thursday June 04, 2015 @05:48PM (#9662361)
> The thing is that the "boring"/average programming jobs are the silent majority.

Let's not forget about all the engineers (making planes, trains, automobiles, and all sorts of other things) who use "advanced math" daily and write software. It's not relevant to OP's question, but we sure like to ignore them. [1]

[1] Is there any data to back up that "boring" programming jobs are actually the majority?

Re:Ask HN: What are some important math topics every program... by Aheinemann on Friday June 05, 2015 @06:20PM (#9668569)
This notion that you do not need any kind of mathematical knowledge is widespread.

Ever tried to delete 1 000 000 files in Windows Explorer ? Select All, Shift delete ?

Takes ages. Why ? because Explorer creates a list of files to be deleted by adding one after the other to the list while updating the screen.

del bak\[asterisk.asterisk] /S /Q /Y >NUL takes some time, but is way faster.

rmdir bak drops the entire directory and returns instantly.

The difference ? O(n^2) versus O(n) versus O(1)

Useful knowledge ? ... possibly.

Even then 'just' programming a website, winging full stack or doing anything worthwile you can get by without knowledge, but it sure helps...

P.S. how do you escape an asterisk ? Even google didn't know / i didn't find it...

Re:Ask HN: What are some important math topics every program... by loco5niner on Thursday June 04, 2015 @05:43PM (#9662329)
> you're better off spending time learning CS topics (e.g. floating point number representation/bugs/limitations, encryption/hashing/etc, binary representations, assembly, kernel inner workings, CPU inner workings, and even borderline electronics)

This. These are things that will directly affect the quality of your code.

Re:Ask HN: What are some important math topics every program... by ColinWright on Thursday June 04, 2015 @05:45PM (#9662343)
Blub.

To expand on that, read Paul Graham's essay "Beating the Averages."

http://www.paulgraham.com/avg.html

You're stating, unequivocally, that math doesn't directly affect the quality of your code. In fact, in seems to me[0] that the vast majority of people who repeatedly declare that math is useless or of minimal use in coding are themselves not qualified in math. To them it's just all abstract nonsense that they don't need.

Contrast that with people who have got deep qualifications in math who say, repeatedly, that it does affect the quality of their code, and it does help.

What do you make of that?

If you don't have any background in math then you won't have the knowledge and experience to see when it will be useful.

[0] I'd love to see a proper survey/study of this.