LillieNB, I completely agree with you, from the engineering standpoint.
But from the employers perspective, they want that code written as cheaply as possible, as fast as possible, using the cheapest possible labour, sorry, 'resource', and they can debug it into existence later, either during test (if there is any test), or in response to customer bug reports after they have shipped it. Their number 1 objective is to make their numbers to please wall street, so the executive gets his fat bonus before he jumps ship in 6 months time. Remember It's a company that makes money, that just happens to produce software of some kind as a by-product. Think of a certain north american aircraft manufacturer, for example.