May-26-2025, 05:55 AM
A function should return a value or print something, without returning anything.
If both is the case, your function has unwanted side effects.
Maybe the author of this function knows this and introduced the ability not to print, if the function is used.
But still, it's annoying if a function prints something, if you expect just a return value.
Sometime libraries are using excessive logging functions, which is also annoying, if activated by default. Then you've to deactivate this manually, if you do not want to have debug output in your program. Most people do not want this.
If both is the case, your function has unwanted side effects.
Maybe the author of this function knows this and introduced the ability not to print, if the function is used.
But still, it's annoying if a function prints something, if you expect just a return value.
Sometime libraries are using excessive logging functions, which is also annoying, if activated by default. Then you've to deactivate this manually, if you do not want to have debug output in your program. Most people do not want this.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!