News for hackers. Stuff that matters.
Re:Parse, Don't Validate (2019) by seanwilson on Tuesday February 10, 2026 @11:48AM (#46962664)
> All the functions taking a string that might end up being a PhoneNumber need to be highly defensive

Yeah, I can't relate at all with not using a type for this after having to write gross defensive code a couple of times e.g. if it's not a phone number, return -1...throw an exception? The typed approach is shorter, cleaner, self-documenting, reduces bugs and makes refactoring easier.

There are no comments on this comment yet.