4 ms·
The failure of engineering in the presented hypothetical examples is a failure to understand the use case. I say this because I remember a class I took in coll
by totalZero 7y ago
The failure of engineering in the presented hypothetical examples is a failure to understand the use case.
I say this because I remember a class I took in college where I built a chat application and the TA chided me for using a hashed message ID instead of using random number generation. I was concerned that eventually there would be collisions and that would lead a message to either be undelivered or delivered to two parties (depending on implementation). The TA said "yeah but that's an infinitesimal risk."
The problem with his view was that the intended user group would eventually see this failure occur. It's not an avoidable edge case, it's a bug that will impact the general use case. The failure could occur on an important message ("I'm gonna be at work late, can you pick up the kids") or a sensitive one ("I can't believe you cheated on me with our babysitter"), and the user would have no idea what happened.
The article mentions NSA hacking and aggressive computation on a small microprocessor, but those issues are both easily avoidable by the atypical user. Are you a spy? Don't rely on HTTPS. Are you building an embedded system? Learn how to use C++ instead of Python.
There is plenty of room within engineering to have sound practices that use computer science to mitigate edge cases. A problem arises when those edge cases don't affect the intended user, or are easily and obviously mitigated by the user choosing a better tool.
- gridlockd 7y agoIf the chance of a collision is literally infinitesimal then the failure will not occur, period. In practice the chance may be just extremely low but then so is the chance that your hash algorithm causes a collision. In fact, that should be more likely for the same number of bits.
- test1235 7y agoSo would you accept that your solution is sound, from an engineering perspective, but could be considered overkill for a college class?
- gridlockd 7y agoA sufficiently large and properly generated random number is as unlikely or less likely to collide than a sufficiently large hash. However, using the random number is strictly simpler to implement, therefore it wins out from an engineering standpoint, unless you do not have access to proper RNG.
- totalZero 7y agoDepends where you go to school.
- scatters 7y agoIf the chance of a random number collision is low enough, it becomes likelier that a message will be undelivered or double-delivered due to hardware error (a "cosmic ray", though more likely thermal noise or radioactivity). Quantum computing in particular hugely relies on the observation that an infinitesimal chance of error is as good as a zero chance. And of course, hashes can collide as well.
- ubu7737 7y agoUsing GUIDv4 presents an infinitesimal risk of collision, particularly given that GUIDv4 space is partitioned by the clock, and globally clocks are roughly synchronized. It's the kind of edge case that you worry about when you are also optimistic that you might win the Powerball lottery in your lifetime. IOW: bad at math.