How do I display a username on their profile pages?
Do I add a computed field?


No


  What's a line of code would I use?


In your theme's .theme file add:

/**
 * Implements hook_preprocess_HOOK().
 */
function THEMENAME_preprocess_page_title(&amp;$variables) { // your theme might already have this function/hook.
  $user = \Drupal::request()-&gt;attributes-&gt;get('user');
  if ($user instanceof \Drupal\user\UserInterface) {
    $variables['title'] = t('Username') . ': ' . $user-&gt;getAccountName();
  }
}


Note: Clear/flush the cache for changes to kick in.