2 switched max and min
source | link

There are a lot of good answers already but there are still more reasons math and programming aren't the same.

1 Mathematical proofs tend to be much simpler than computer programs. Consider the first steps of a hypothetical proof:

Let a be an integer

Let b be an integer

Let c = a+b

So far the proof is fine. Let's turn that into the first steps of a similar program:

Let a=input();

Let b=input();

Let c = a+b;

We already have a myriad of problems. Assuming that the user really did enter an integer, we have to check the bounds. Is a greater than -32768 (or whatever the maxmin int on your system is)? Is a less than 32767? Now we have to check the same thing for b. And because we've added a and b the program isn't correct unless a+b is greater than -32768 and less than 32767. That's 5 separate conditions a programmer has to worry about that a mathematician can ignore. Not only does the programmer have to worry about them, he has to figure out what to do when one of those conditions isn't met and write code to do whetever he has decided is the way to handle those conditions. Math is simple. Programming is hard.

2 The questioner doesn't say whether he's referring to compile-time errors or run-time errors, but programmers generally just don't care about compile-time errors. The compiler finds them and they're easy to fix. They're like typos. How often do people type several paragraphs without errors the first time?

3 Training. From a very young age we are taught to do math, and we face the consequences of minor mistakes over and over again. A trained mathematician had to start solving multi-step algebra problems usually in middle school and had to do dozens (or more) such problems every week for a year. A single dropped negative sign caused an entire problem to be wrong. After algebra the problems got longer and more difficult. Programmers, on the other hand, usually have far less formal training. Many are self-taught (at least initially) and didn't get formal training until university. Even at the university level, the programmers have to take quite a few math classes while the mathematicians probably took one or two programming classes. It should hardly be surprising the even programmers tend to have decent math skills while mathematicians find it difficult to get a program right.

There are a lot of good answers already but there are still more reasons math and programming aren't the same.

1 Mathematical proofs tend to be much simpler than computer programs. Consider the first steps of a hypothetical proof:

Let a be an integer

Let b be an integer

Let c = a+b

So far the proof is fine. Let's turn that into the first steps of a similar program:

Let a=input();

Let b=input();

Let c = a+b;

We already have a myriad of problems. Assuming that the user really did enter an integer, we have to check the bounds. Is a greater than -32768 (or whatever the max int on your system is)? Is a less than 32767? Now we have to check the same thing for b. And because we've added a and b the program isn't correct unless a+b is greater than -32768 and less than 32767. That's 5 separate conditions a programmer has to worry about that a mathematician can ignore. Not only does the programmer have to worry about them, he has to figure out what to do when one of those conditions isn't met and write code to do whetever he has decided is the way to handle those conditions. Math is simple. Programming is hard.

2 The questioner doesn't say whether he's referring to compile-time errors or run-time errors, but programmers generally just don't care about compile-time errors. The compiler finds them and they're easy to fix. They're like typos. How often do people type several paragraphs without errors the first time?

3 Training. From a very young age we are taught to do math, and we face the consequences of minor mistakes over and over again. A trained mathematician had to start solving multi-step algebra problems usually in middle school and had to do dozens (or more) such problems every week for a year. A single dropped negative sign caused an entire problem to be wrong. After algebra the problems got longer and more difficult. Programmers, on the other hand, usually have far less formal training. Many are self-taught (at least initially) and didn't get formal training until university. Even at the university level, the programmers have to take quite a few math classes while the mathematicians probably took one or two programming classes. It should hardly be surprising the even programmers tend to have decent math skills while mathematicians find it difficult to get a program right.

There are a lot of good answers already but there are still more reasons math and programming aren't the same.

1 Mathematical proofs tend to be much simpler than computer programs. Consider the first steps of a hypothetical proof:

Let a be an integer

Let b be an integer

Let c = a+b

So far the proof is fine. Let's turn that into the first steps of a similar program:

Let a=input();

Let b=input();

Let c = a+b;

We already have a myriad of problems. Assuming that the user really did enter an integer, we have to check the bounds. Is a greater than -32768 (or whatever the min int on your system is)? Is a less than 32767? Now we have to check the same thing for b. And because we've added a and b the program isn't correct unless a+b is greater than -32768 and less than 32767. That's 5 separate conditions a programmer has to worry about that a mathematician can ignore. Not only does the programmer have to worry about them, he has to figure out what to do when one of those conditions isn't met and write code to do whetever he has decided is the way to handle those conditions. Math is simple. Programming is hard.

2 The questioner doesn't say whether he's referring to compile-time errors or run-time errors, but programmers generally just don't care about compile-time errors. The compiler finds them and they're easy to fix. They're like typos. How often do people type several paragraphs without errors the first time?

3 Training. From a very young age we are taught to do math, and we face the consequences of minor mistakes over and over again. A trained mathematician had to start solving multi-step algebra problems usually in middle school and had to do dozens (or more) such problems every week for a year. A single dropped negative sign caused an entire problem to be wrong. After algebra the problems got longer and more difficult. Programmers, on the other hand, usually have far less formal training. Many are self-taught (at least initially) and didn't get formal training until university. Even at the university level, the programmers have to take quite a few math classes while the mathematicians probably took one or two programming classes. It should hardly be surprising the even programmers tend to have decent math skills while mathematicians find it difficult to get a program right.

1
source | link

There are a lot of good answers already but there are still more reasons math and programming aren't the same.

1 Mathematical proofs tend to be much simpler than computer programs. Consider the first steps of a hypothetical proof:

Let a be an integer

Let b be an integer

Let c = a+b

So far the proof is fine. Let's turn that into the first steps of a similar program:

Let a=input();

Let b=input();

Let c = a+b;

We already have a myriad of problems. Assuming that the user really did enter an integer, we have to check the bounds. Is a greater than -32768 (or whatever the max int on your system is)? Is a less than 32767? Now we have to check the same thing for b. And because we've added a and b the program isn't correct unless a+b is greater than -32768 and less than 32767. That's 5 separate conditions a programmer has to worry about that a mathematician can ignore. Not only does the programmer have to worry about them, he has to figure out what to do when one of those conditions isn't met and write code to do whetever he has decided is the way to handle those conditions. Math is simple. Programming is hard.

2 The questioner doesn't say whether he's referring to compile-time errors or run-time errors, but programmers generally just don't care about compile-time errors. The compiler finds them and they're easy to fix. They're like typos. How often do people type several paragraphs without errors the first time?

3 Training. From a very young age we are taught to do math, and we face the consequences of minor mistakes over and over again. A trained mathematician had to start solving multi-step algebra problems usually in middle school and had to do dozens (or more) such problems every week for a year. A single dropped negative sign caused an entire problem to be wrong. After algebra the problems got longer and more difficult. Programmers, on the other hand, usually have far less formal training. Many are self-taught (at least initially) and didn't get formal training until university. Even at the university level, the programmers have to take quite a few math classes while the mathematicians probably took one or two programming classes. It should hardly be surprising the even programmers tend to have decent math skills while mathematicians find it difficult to get a program right.