laziness, impatience, and hubris PerlMonks

Re: OT: Mathematics for programming (again)

by mr_mischief (Monsignor)
 on Sep 10, 2008 at 23:46 UTC ( #710493=note: print w/replies, xml ) Need Help??

in reply to OT: Mathematics for programming (again)

If you are looking for more mathematical influence in programming, then you're probably looking in the wrong directions for it. Math is very useful to programming in some ways and not very helpful in others.

One place to look to math is for notation and theory of the programming language itself. Lisp and its many dialects are based on the lambda calculus. Forth can be very simple because it borrows postfix notation, which is designed to make order of operation unambiguous.

Another place math is very useful to programming is in optimization. By developing software using algorithms which grow slowly in necessary operations compared to the volume of data, we can make major improvements in the performance of code at a high level. By simplifying expressions, we can get a few more cycles here and there as microoptimizations when needed. Math can be used to prove the equivalency of two solutions, but regression testing should still be used just in case.

Math can be useful in approximation routines for heuristic solutions that would take too long to solve using strict algorithms. It can also be useful to choose when it's necessary to use a heuristic and when the body of data is small enough to use a fast-growing algorithm.

Some people will say that math is useful to programming for simulations, accounting, data mining, and statistics. I'd say that's not quite right. I'd say in those cases the math is useful to the programmer and the user. It's not really useful to the act of programming as an external influence, though, because that part of the programming itself is math.

All of these are good reasons that a math or hard science background can help one as a programmer. Being able to program things that use math is different from using math to improve programs, though. The former is domain-specific programming where the domain is mathematical in nature. The latter is the field of Computer Science.

Many programmers can get by writing software with just a solid grasp of high-school algebra and a rudimentary understanding of CS. This is possible by using guides to algorithms written by other people who have done the research, and by not writing programs that require much math in themselves. To write a solid mathematically-centered program, you have to know the math yourself. It helps to have the math background even if you're not programming mathematically intensive code, because math can describe many things about a program that are quite useful to know.

• Comment on Re: OT: Mathematics for programming (again)

Create A New User
Node Status?
node history
Node Type: note [id://710493]
help
Chatterbox?
 [Corion]: And the second rule that I've learned is, that there is no one-off job, so writing a program for it pays off almost immediately. The third rule is to give all my programs numbers and have them reproduce that number in the name of their output files. :) [Discipulus]: the true part is that also specification change between years.. but well our job is cheap but dont abuse of us.. ;=) [LanX]: Choroba: do you miss chaos with ties? apply at the US government.. ;) [ambrus]: Corion: those are good rules. [ambrus]: Discipulus: oh sure. the input data has different filenames every time I get them. [ambrus]: the directory structure may be 1, 2, or 3 deep, it may have spaces in the filename or not, it has dates in various format, different keywords for the same meanings, and the dates and other keywords are assembled in various ways. [Discipulus]: no ambrus by specification i mean for example license per core instead of per socket, so fields are different

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2017-03-29 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should Pluto Get Its Planethood Back?

Results (350 votes). Check out past polls.