One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
I was sure you handled that in your Impressive serie!
I completely agree with Use Exceptions just for unexpected situations and not for flow control because they are handy goto.
I go further than you though. By unexpected situations, I mean a programmer error (like your for each loop), or your VM going out of memory.
The network to fail on the other hand is a case that a programmer must totally expect. So I would use a Either<Failure, Success> to force him to always handle this case.
Obviously that works only in programming who supports lambdas and generics. If not fallback on the handy gotos.
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
I was sure you handled that in your Impressive serie!
I completely agree with
Use Exceptions just for unexpected situations
and not for flow control because they arehandy goto
.I go further than you though. By unexpected situations, I mean a programmer error (like your for each loop), or your VM going out of memory.
The network to fail on the other hand is a case that a programmer must totally expect. So I would use a
Either<Failure, Success>
to force him to always handle this case.Obviously that works only in programming who supports lambdas and generics. If not fallback on the handy gotos.
can you elaborate on Either
is this some kind of flag boolean function ?
Going tomorrow on a trip, and short of time, but I've found a DEV article that sums it well
Error Handling with the Either type
MiloΕ‘ Ε ikiΔ γ» Mar 31 γ» 12 min read