On separating preconditions from business rules.
@Iteria@sh.itjust.works
link
fedilink
English
61Y

I don’t think I’ve ever had a working definition of a business rule beyond what feels right intuitively. I’m going to carry this forth with me.

Perhaps you’ve been reading this with mounting frustration: How about validating the address according to the SMTP spec?

Indeed, that sounds like something one should do, but turns out to be rarely necessary. As already outlined, users can easily supply a bogus address like foo@bar.com. It’s valid according to the spec, and so what? How does that information help you?

I feel like this is the difference between an academic and a professional. One is trying to do it provably right and the other is trying to satisfy a need with limited resources.

@canpolat@programming.dev
creator
link
fedilink
English
31Y

Recently, I have seen web apps that requires an email address, then does the validation by sending an email to that address and only then allows the user to proceed with registration. That’s probably the only sure way of validating an email. Users may still use disposable email addresses or short-lived aliases. But I think that’s acceptable.

@Iteria@sh.itjust.works
link
fedilink
English
51Y

Well… yes. That was the point made in the article. Validating the email address doesn’t do anything. The easiest way is to just sent a link to the entered address and see if the user can click it.

@the_artic_one@programming.dev
link
fedilink
English
1
edit-2
1Y

The academic view here is also ignoring the improved UX you get by being able to tell a user immediately if they’ve failed to fully type out email address which could happen for any number of reasons (another application stealing focus after they started typing, hitting tab by accident, certain kinds of typos, etc.).

@nyan@lemmy.cafe
link
fedilink
English
21Y

I realize the author was just using it as an example, but man perlfaq9 manages to cover the same material on email validation a lot more succinctly. This Is Not A New Problem.

Would’ve never expected this read to be so interesting.

Create a post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



  • 1 user online
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1 user / 6 months
  • 1 subscriber
  • 1.21K Posts
  • 17.8K Comments
  • Modlog