DEV Community

loading...

Discussion on: Practical Coding Patterns For Boss Developers #1: Special Case

Collapse
jamesmh profile image
James Hickey Author

I'm not quite sure what your first question is?

For the second question, if you are talking about trying to fail fast on the "fraud detection" (I think that's perhaps what you're trying to say), then it still applies here.

Within the long running process,fraud will be detected early on (before any payments are made etc.). However, it's not a good idea to do that type of check "right away" - like during the HTTP request from the user since making that check would involve making some external API checks (most likely) and take a while.

We wouldn't want our user sitting there, watching a loading spinner on his screen, for a few minutes 😂

There's always trade-offs. By making a longer-running process like this then the trade-off is that the user doesn't have to be directly involved while waiting, but it might take a little bit longer for the entire process to complete.

Collapse
qcgm1978 profile image
Youth

I think trade-off is a great word to describe the conditions. We should delay the detection on the beginning of development phases and expect it crash as soon as possible. And complete the program to satisfy the code logic and business logic step by step. At last we should consider to set up the closed cycle in fixing bugs phase.

So I think we should change our thinking paradigms in different development phases.