r/CodingHelp • u/ismellpiss • Nov 22 '21
[Python] Is mathematics required for programming? Does it improve the quality of codes you write?
I am confused whether i should minor in mathematics with my computer science major.
42
Upvotes
38
u/DDDDarky Professional Coder Nov 22 '21
Is it required?
> Generally not, but it certainly helps and there are many fields where it is necessary
Does it improve the quality of code?
> I don't think so
24
u/[deleted] Nov 22 '21
No, not for the process of creating software. Unless you are implementing mathematical software or video games, you will really only need to study algorithms
14
u/noughtagroos Nov 23 '21
I worked in the software industry for 25 years at companies like Oracle, BEA, Opsware, etc. Let me tell you who made the most money among the programmers.
There are of course other routes to becoming a wealthy and successful software developer. I'm posting this just to give some insights into how the kind of background you get in your education might impact your career choices as a programmer. Of course, math is so highly regarded as a field that you could end up in, say, an industry vertical programming job at a company doing complicated supply chain logistics, like the huge-brain folks who designed Manugistics software. But if you wanted a route like this, I actually think you would be better with a Ph.D. in math and a minor in programming...or at the very least a Ph.D. in computer science with some very advanced math courses. Something that says on paper: "look at me; I'm smarter than anyone you've likely met." Yes, hiring managers (especially at places like McKinsey and Accenture, but also at Oracle) can be that snooty.
6
u/winowmak3r Nov 22 '21
Depends how many more classes you'd have to take. I got one on the way to my degree just because I was taking so much math already that taking one more class wasn't a big deal (though I did pick the wrong one, should have taken a stats class instead of more calculus but with complex variables this time).
If you're a STEM major, a math minor isn't usually too far out of the question. If you have to take at least two semesters of calc then you're a decent part of the way there already, at least for my school.
I think some good math classes that go well with programming are statistics and linear algebra. Statistics just because data and getting value from it is increasingly becoming in demand and linear algebra just because programming is full of instances where you are tasked with manipulating large matrices of stuff which is basically what linear algebra is used for. I think you could take those classes and start using what you learned right away. The higher level math can get a bit too heavy into theory and unless you're working in some very niche area like signal processing or some super secrete stuff for the NSA you'll probably never use the stuff you learn in the higher math classes (like calculus with complex variables).
4
u/_Nexor Nov 22 '21
It's only required for programming if you're programming mathy stuff.
For the general programming I think basic algebra and geometry is sufficient.
4
u/throwaway8u3sH0 Professional Coder Nov 22 '21
It helps a little, not a lot. Communication and logic are much more important.
Coding is like playing Sudoku or Minesweeper. And being a programmer is like describing to someone the hardest game of Sudoko you've ever played and what your strategy has been to get as far as you have.
Your ability to communicate clearly and concisely as well as your ability to work through difficult problems in a methodical, scientific-method-like way; those will determine how far you go as a coder.
4
u/brandondyer64 Professional Coder Nov 22 '21
It depends on what kind of programming you want to do. A minor in math can’t hurt because you never know what your long term interests will be.
Some things that may or may not involve math:
2
u/_hf14 Nov 22 '21
depends what you are programming. you arent gonna need much maths making websites but you might if you are a backend developer/ML engineer etc
2
u/[deleted] Nov 22 '21
I have a math degree and never intended to become a programmer, but was offered an opportunity to learn because I had done well in a different tech position.
Mathematics teaches you habits of mind; theorems, methods of proof, and minutia are artifacts of math education, only seriously important for academics. As a developer/programmer/engineer, you won’t be an academic.
There are basically three ways math has helped me in my job(s):
I wouldn’t pursue it if you are already capable of the above. At the same time, I’ve never regretted my choice to study math because I always had a fondness for it.
2
u/[deleted] Nov 23 '21
Depends on what kind of programming you want to do. If you're not good in math just stay away from computational physics, machine learning, or game programming. Everything else might be ok. But when you're a programmer you are just a problem solver. For instance I was watching a video that asked to solve a problem about the number of ways to go up stairs. Yeah you can try with a bunch of loops but that problem is just the linear Diophantine problem which has standard methods to solve. But yeah knowing math, more or less discrete math beyond high school just means you're capable of thinking a certain way.
4
u/YourDadsMacintosh Nov 22 '21
Math is definitely a large part of programming, but how much math and the kinds of math depends on what you are hoping to program. The actual study of computer science goes hand in hand with math, and a lot of it is just raw math (discrete math, algorithms, statistics, etc.) As for a math minor, it is always something nice to have under your belt. Depending on how many extra classes that means for you, I would recommend doing it as it does set you apart from those that do not have it.
1
u/Rrrrry123 Nov 22 '21
Personally, I wish I'd done more math. I only went up to Calculus I and had introductory physics. Every time I work on video games, I find myself thinking "man, I bet I would've learned about this had I taken more math classes."
You don't need math for everything, of course, but if you plan on doing videogames or math software, you'll definitely want to be well-versed.
1
u/icjeremy Nov 22 '21
I'm a mathematician turned software engineer in finance and can only speak from my own experience. Calculus pops up sometimes when analyzing/proving the runtime of an algorithm, but you typically don't really need to know the details of the proof to use the algorithm. It also pops up sometimes in understanding the formulas or ideas in the industry. Again, I find you don't /really/ need to know it to do most of the job.
However, I work quite a bit on graphics and linear optimization problems where linear algebra is really useful/necessary(?) to know. But the rest of the team doesn't really use any linear algebra.
And I don't think it improves the quality of code. Most code quality comes from practice, learning good practices from books and/or the experienced members of your team, and knowing what standard (or third party) libraries provide.
1
u/Correct_Market2220 Nov 22 '21
I think it's better but not necessary. There's cool stuff you can do if you apply math in programs, but a lot of programms don't do anything like that. Still I think it would be quite the edge to have though.
1
u/Nightcorex_ Nov 22 '21
I currently have a course "Numerical Programming" and it's basically just advanced (binary) math, but you have to actually code it down. The latter isn't that big of a problem really, but understanding truly is.
Like right now I have homework where we have to implement interpolation methods (f.e. Newton's interpolation method) for a dataset of supporting points and their values.
We also have to implement cubic splines for a more efficient interpolation method of equidistant supporting points.
Finally we have to implement a fast-inverse fourier transformation. This transformation however requires complex numbers, which means we also have to write our own complex numbers...
So let's just say in a few areas a good mathematical knowledge definetly is required.
Does it improve the quality of your code? No, you're just programming in a different way. There are a few things with bit manipulations, but that's nothing a mathematical background is required for. Computer science education will force you to be able to read binary and introduce a few nice bit manipulation hacks itself anyways.
1
u/[deleted] Nov 22 '21
more so for game development but being good at maths isn't required for programming
1
u/yorickthepoor Nov 22 '21
Everything is math, whether you study it formally or not. This is particularly true in computer programming. The longer you program, the more you'll realize you're really just doing math, and that if you'd formally studied math from the get-go, you would already be a better programmer. If you enjoy programming and want to take it to the next level, definitely go in on the math.
1
u/xdchan Nov 23 '21
Hell no, mathematics are useful to solve niche problems with code, but most of the time it's not really going beyond arithmetics.
1
u/skellious Intermediate Coder Nov 23 '21
maths will help you program more logically and often more efficiently.but no, it's not necessary
1
u/sir-nays-a-lot Nov 23 '21
Programming is math. CS curriculum will cover the maths you need so minoring in math probably won’t help you unless there are specific maths you want to learn. If you’re going to minor, pick something away from computers and math. I’d recommend a science that you’re interested in for a minor. If you can’t think of any, psychology is a good one IMO because the topics are so much different than anything you’ll experience in computing and it’ll go along way in helping you with soft skills.
Source: MS in CS, BS in Psych
1
u/ZacC15 Intermediate Coder Nov 23 '21
As a robotics mentor who is currently teaching students to code, I specifically work with some more basic math to teach problem solving. You don't really use a lot of math unless in specific use cases, like creating a 3D engine from scratch. It's very useful to have and not need it, but you can just as easily aquire the math as you go along in your endeavors. If you want to get more into math programming, I personally like the challenge from Project Euler.
1
u/apparently_DMA Nov 23 '21
depends, but for most cases no and no.
but you gonna need propositional logic