3 ms·
I've seen someone take a piece of code from 72 lines down to 3 lines by just doing some simple mathematical analysis before actually getting to refactoring. The
by felipellrocha 12y ago
I've seen someone take a piece of code from 72 lines down to 3 lines by just doing some simple mathematical analysis before actually getting to refactoring. The code was also simpler, and easier to understand.
Do you need math for be a good programmer? No. Does it help to know math while programming? Absolutely.
- ivanmaeder 12y agoThat's sounds like example of someone with math skills applying them to make an awesome bit of code. But I've also heard about math PhDs write the sloppiest code code imaginable: functions 1000+ lines long, copying and pasting functions to add a parameter... (in production code for a software company, not a research project). So like you said, math helps but I'd like to extend that thought and say that you can make bigger gains elsewhere. For example, if you're a sloppy coder and don't know math, go out and get a book like "Code Complete," "The Pragmatic Programmer" or "Clean Code" first.
- wvenable 12y agoI've also seen a programmer waste 6 months on code that didn't solve the problem because he was a poor communicator and got all the requirements wrong. I don't disagree with your point but it doesn't really mean that much. A good programmer needs to be well rounded -- understand math, logic, language, human nature, etc. If you're calculating missile trajectories; math is going to be a more important component. If you building a Facebook plugin, it's probably much less important than other skills.
- felipellrocha 12y ago(1) I don't understand how the programmer wasting 6 months relates to my example. (2) I don't believe you know what math is/isn't, calculating missile trajectories is just one way of doing math. Math is not the same thing as Arithmetic. Also, depending on the type of plugin, math can be quite a useful tool. For starters, if you're playing with Facebook's graph api, knowing about graph theory can be quite handy.