News for hackers. Stuff that matters.
Re:Where Everything Went Wrong: Error Handling and Error Mes... by junke on Friday February 19, 2021 @09:43AM (#26193640)
The specification and boundary conditions directly comes from an analysis of the expected usage. Except for some all-purpose libraries you don't develop in a vacuum (assuming you don't work for Roomba).
Re:Where Everything Went Wrong: Error Handling and Error Mes... by enriquto on Friday February 19, 2021 @10:01AM (#26193868)
But design and coding are different steps, best kept separate. When you are designing, I agree with you, the expected usage is very important. But in the design step the particular language mechanism for dealing with conditions does not matter. Once you get a specification to program to, all input conditions can be treated as equal. That is, unless you need to optimize heavily by biasing your execution path for a certain percentage of input cases (which should be clearly described in the specification).
Re:Where Everything Went Wrong: Error Handling and Error Mes... by junke on Friday February 19, 2021 @10:10AM (#26193974)
> Once you get a specification to program to, all input conditions can be treated as equal.

And if the spec says "try downloading the file 3 times at 5 seconds interval; if that fails, give up the update", I am free to implement it however I want (?) unless I missing your point.

Re:Where Everything Went Wrong: Error Handling and Error Mes... by enriquto on Friday February 19, 2021 @12:14PM (#26195289)
sure! for example, in your case you only need a for loop and an if/else statement
Re:Where Everything Went Wrong: Error Handling and Error Mes... by coderdd on Friday February 19, 2021 @05:07PM (#26198652)
Ideally yes, but most of the time I find I have no idea about what I want to do. Idea leads to code, code reveals constraints, those lead to other ideas. If we could specify things, code writing AI would be easy. But most of the time, we just have no idea.