DEV Community

Matthew DesEnfants
Matthew DesEnfants

Posted on

Talking about time like a human.

#ux

Jotting down some notes, because this is a conversation I've had a few times with my teams.

Software engineers tend to talk about time in unambiguous mathematical terms, using formats we've constructed purely for the sake of making sure the computers do the right things as the right time in ways that we design and debug. We've lost our humanity.

When building a workflow tool, nontechnical query language, or whatever, you need to communicate to your users whether you're describing a moment in time or a length of time.

For the sake of conversation:

time span = length of time
time stamp = moment in time

Reflect on these translations:

  • "Once a week (time stamp), check which users have not been notified of their outstanding points in the last month (time span)."
  • "Run the next step of this workflow after waiting 3 days (time span) from today (time stamp)."
  • "Look up contacts that have changed within 3 days before (time span) midnight on Christmas (time stamp)."
  • "Send this email one week (time span) after New Years (time stamp)."
  • "Find anyone who requested a refund within three weeks (time span) of our last promotion (time stamp)."

The statements above can be translated to the appropriate code while being much more approachable to a marketer or accountant.

if record.change_date < ago(30d) is just begging for a support ticket.

Top comments (0)