'How to return many conditional strings when creating shortcode in WordPress

I'm new to shortcode and PHP. I'm creating a shortcode by following many tutorials such as this. Is the below safe and recommended to do when trying to add a long output conditional string in a shortcode? Or is there a better way?

function some_shortcode() {
 if(/*condition*/) {
  $return = "Something...";
 }
 $return .= "...interesting";
 
 return $return;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source