4 ms·
I don't quite understand the VerifiedEmailAddress example. Seems like you're just moving Address(verified: true) into the name. But since both of the email type
by activitypea 4y ago
I don't quite understand the VerifiedEmailAddress example. Seems like you're just moving Address(verified: true) into the name. But since both of the email types aren't types but rather containers for a string, they're not interchangeable in nominal nor structural type systems, so you're creating a bunch of noisy code like `changePassword(new EmailAddress(verifiedEmailAddress.getValue())`. This is like the worst aspects of the "it's just data" approach combined with the worst aspects of encapsulation.
> Using a primitive string for an object which could get so easily expressed through its own type is simply lazy and unimaginative programming.
What a shallow and incurious take. Funny you should complain about "lazy programmers", when the only justification for this approach you present I would classify as gross negligence, if not grounds for termination. Who in the world would set "verified" to be true by default?