News for hackers. Stuff that matters.
Re:Parse, Don't Validate (2019) by ambicapter on Tuesday March 07, 2023 @06:49PM (#35063117)
> In practice, I find it is usually something like 'UnvalidatedCustomerInfo' being parsed into a 'CustomerInfo' object, where you can validate all of the fields at the same time

In my experience you usually can't validate them all at the same time. For example, address. You usually don't validate that until after the customer has selected items, and then you find out that some items won't deliver to their area, so whereas you previously had a Valid basket, now it's an Invalid state.

Re:Parse, Don't Validate (2019) by initplus on Tuesday March 07, 2023 @06:58PM (#35063216)
Whether an item can be delivered to a particular address seems like a seperate concern to whether the address is correct/real.
Re:Parse, Don't Validate (2019) by przemo_li on Tuesday March 14, 2023 @01:40PM (#35155316)
Valid basket does not imply valid order.

Sometimes just splitting stuff into more types that are appropriate to specific portion of pipeline is a win.