Skip to main content
7 events
when toggle format what by license comment
Jan 30, 2020 at 19:19 comment added Eric Lippert No, I'm genuinely confused. If the input is always in the desired format then there is no need to write a validator that confirms that except, say, as an assertion. Also, as I noted, the original code assumes that the input is definitely in a form that has at least two dashes; it crashes otherwise, indicating that the code has never been tested in an environment where that invariant was violated. It is unclear to me what properties are actually being tested for here, and why the existing code assumes some invariants are met but not others.
Jan 30, 2020 at 10:00 comment added Mr47 @ZevSpitz Eric is not confused; that's just a rhetorical question
Jan 30, 2020 at 4:47 comment added user20416 @EricLippert Perhaps to validate that the input actually matches the format?
Jan 29, 2020 at 23:25 comment added Eric Lippert @Travis: I am confused. If the input is always in that format then why do you need the function at all?
Jan 29, 2020 at 16:49 comment added Travis The input is always in a format of XXX-XXXXXXXX-XXX. The insides dont mean much to me yet
Jan 29, 2020 at 16:30 review First posts
Jan 29, 2020 at 17:11
Jan 29, 2020 at 16:26 history answered meta CC BY-SA 4.0