Use return
in functions or not - that's the question
#134
Replies: 4 comments 4 replies
-
Agreed - no need for return |
Beta Was this translation helpful? Give feedback.
-
ok, let's do it then, moving forward for all new functions or functions we are changing for a specific business reason. |
Beta Was this translation helpful? Give feedback.
-
The return statement is a helpful feature in PowerShell, especially when you want to control the flow of a function or clearly define its final output. That said, I don't believe it should be treated as a strict requirement. Flexibility is important too. |
Beta Was this translation helpful? Give feedback.
-
Let's provide examples Standards, and we will be able to implement a new approach moving forward. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Should we use
return
statement in functions to return value(s) or shouldn't?I'm not fully convinced of not using them (for readability), but I'm happy for us to discuss and agree the best approach.
Beta Was this translation helpful? Give feedback.
All reactions