I'm a beginner in programming and I'm studying C++ using Programming principles and practice using C++. Today Now I'm studying the chapter about the errors and in one paragraph the author explains the importance of estimation, but I have a problem because I cannot understand why estimation ( remember that I have just 2 months of experience in programming ) is so important. Let me explain in a better way :
To give me an example of estimation the author makes an example where we have to imagine that he wrote a program that calculates the driving distance between two cities, and we want to know whether a given value is reasonable, for example: is a reasonable driving time of 15 hours between New York and Denver? Obviously to come to a conclusion we need to know the distance (looking on the web) between New York and Denver.
My question is: why can not we just check on the web if the result of our program is that correct? Why make estimates appears to be so important? Why the author states that make estimates can avoid us a lot of wasted time and confusion?
Because sometimes you cannot look things up on the web. Imagine a sales management app that calculates the discount on a sale. You cannot google that to find the answer. But if you write the app and it returns a discount of 10,000,000$ on an order of 100$ then that's probably wrong.
What he is really saying is that you will write much better programs if you understand the problem domain, ie you understand what its supposed to do
Imagine being asked to write a program that computes the frunk ratio of the splidge grouters given that each froop has 12 enzags. Is 42 a good answer? Many times I have seen devs in this situation - they have 0 idea of what the program is actually doing and so cant tell if they are writing junk