Sep-06-2020, 07:24 AM
Your example is quite contrived, but in general, this is better design yes. In a real example, these functions would do more complex things and separating the concern of printing from what their main job is would make them more reusable, easier to test and maintain.