3 ms·
For this particular case it's trivial to fix substring function and extend possible inputs. It seems your proposition: "do nothing because it's futile". It's si
by bvrmn 2y ago
For this particular case it's trivial to fix substring function and extend possible inputs. It seems your proposition: "do nothing because it's futile". It's simply wrong.
- grandempire 2y agoWill that make the function more useful? In general you can write better code when you can make assumptions. Code to handle every possibility is filled with error prone branching, that reduplicates effort at every function.
- bvrmn 2y agoIt would reduce number of assumptions, especially ones laying only in your head. Generally it's a good thing, isn't it? Literally large portion of C code bugs is due to broken assumptions. WTF man?