Click here to Skip to main content
15,888,527 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
RantEdge case or poor planning Pin
kmoorevs21-Apr-22 8:32
kmoorevs21-Apr-22 8:32 
GeneralRe: Edge case or poor planning Pin
CodeWomble21-Apr-22 10:25
CodeWomble21-Apr-22 10:25 
GeneralRe: Edge case or poor planning Pin
kmoorevs21-Apr-22 11:24
kmoorevs21-Apr-22 11:24 
GeneralRe: Edge case or poor planning Pin
dandy7221-Apr-22 9:39
dandy7221-Apr-22 9:39 
GeneralRe: Edge case or poor planning Pin
jmaida21-Apr-22 9:50
jmaida21-Apr-22 9:50 
GeneralRe: Edge case or poor planning Pin
kmoorevs21-Apr-22 11:22
kmoorevs21-Apr-22 11:22 
GeneralRe: Edge case or poor planning Pin
dandy7222-Apr-22 4:30
dandy7222-Apr-22 4:30 
GeneralRe: Edge case or poor planning Pin
honey the codewitch21-Apr-22 13:14
mvahoney the codewitch21-Apr-22 13:14 
Overvalidation requires overtesting which itself causes more churn. That's the brutal irony of the situation.

The other day I spent almost an entire day poring over a routine because the test for it was broken - but it wasn't even the test itself, but bad metrics in a font file i downloaded.

I also can't count the number of times I've had to remove parameter validation as routines get nested inside the internals instead of being part of that API's surface area as things evolve, or to extend them with optional (read: nullable) parameters.

But worse is a situation like you describe. It's not an edge case - and the reason for that is you don't know all the situations in which the machine can be reset, necessarily - or do you? What about an EMP? Ergo, it's a failure condition that's not being handled gracefully. Therefore, it's a design flaw, and one that would have been non-obvious to catch in the design phase.

You got bit, only I don't think you did anything wrong, because erring on the side of overvalidating is better than the alternative, but honestly, I would have done your time validation at another level, like halt if the clock isn't greater than the last time you read it, and I would have skipped the transaction amount accumulation checking altogether barring a scenario you can think of where it's necessary.

Can you pull it out?

Can you adjust the clock code so it checks that the clock's good on start, instead of checking it where you are? That way all you theoretically have to do to restart it on a machine reset it set the clock.

I'm flying blind here, so I may be talking out my backside, but all of this is just stuff that occurred to me.
To err is human. Fortune favors the monsters.

GeneralRe: Edge case or poor planning Pin
englebart21-Apr-22 14:25
professionalenglebart21-Apr-22 14:25 
GeneralRe: Edge case or poor planning Pin
Sander Rossel21-Apr-22 20:56
professionalSander Rossel21-Apr-22 20:56 
GeneralRe: Edge case or poor planning Pin
jsc4222-Apr-22 0:30
professionaljsc4222-Apr-22 0:30 
GeneralRe: Edge case or poor planning Pin
Gerry Schmitz22-Apr-22 9:42
mveGerry Schmitz22-Apr-22 9:42 
GeneralLooking for recommendations Pin
Slow Eddie21-Apr-22 8:06
professionalSlow Eddie21-Apr-22 8:06 
GeneralRe: Looking for recommendations Pin
charlieg21-Apr-22 8:11
charlieg21-Apr-22 8:11 
GeneralRe: Looking for recommendations Pin
Slow Eddie21-Apr-22 9:17
professionalSlow Eddie21-Apr-22 9:17 
GeneralRe: Looking for recommendations Pin
0x01AA21-Apr-22 10:23
mve0x01AA21-Apr-22 10:23 
GeneralRe: Looking for recommendations Pin
Slacker00721-Apr-22 8:25
professionalSlacker00721-Apr-22 8:25 
GeneralRe: Looking for recommendations Pin
Slow Eddie21-Apr-22 9:18
professionalSlow Eddie21-Apr-22 9:18 
GeneralRe: Looking for recommendations Pin
RickZeeland21-Apr-22 9:30
mveRickZeeland21-Apr-22 9:30 
GeneralRe: Looking for recommendations Pin
Slow Eddie22-Apr-22 2:10
professionalSlow Eddie22-Apr-22 2:10 
JokeRe: Looking for recommendations Pin
Gary Wheeler22-Apr-22 1:59
Gary Wheeler22-Apr-22 1:59 
GeneralRe: Looking for recommendations Pin
Slow Eddie22-Apr-22 2:11
professionalSlow Eddie22-Apr-22 2:11 
GeneralRe: Looking for recommendations Pin
Slow Eddie22-Apr-22 2:15
professionalSlow Eddie22-Apr-22 2:15 
GeneralRe: Looking for recommendations Pin
Matt Bond22-Apr-22 3:58
Matt Bond22-Apr-22 3:58 
GeneralRe: Looking for recommendations Pin
Kirk 1038982122-Apr-22 4:27
Kirk 1038982122-Apr-22 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.