News for hackers. Stuff that matters.
Re:Simplify Your Code: Functional Core, Imperative Shell by rahimnathwani on Monday October 27, 2025 @06:18PM (#45726989)

  If you want to do one email for expired users and another for non expired users and another email for users that somehow have a date problem in their data....
Well, in that case you wouldn't want to pipe them all through generateExpiryEmail.

But perhaps you can write a more generic function like generateExpiryEmailOrWhatever that understands the user object and contains the logic for what type of email to draft. It might need to output some flag if, for a particular user, there is no need to send an email. Then you could add a filter before the final (send) step.

There are no comments on this comment yet.