Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand on code reuse practices and considerations when scripting #9898

Open
3 tasks done
iRon7 opened this issue Mar 13, 2023 · 0 comments
Open
3 tasks done

Expand on code reuse practices and considerations when scripting #9898

iRon7 opened this issue Mar 13, 2023 · 0 comments
Labels
area-conceptual Area - Conceptual articles area-sdk-docs Area - SDK docs issue-doc-idea Issue - request for new content up-for-grabs Tag - issue is open for any contributor to resolve

Comments

@iRon7
Copy link
Contributor

iRon7 commented Mar 13, 2023

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Typo in Get-Foo cmdlet" instead of "Typo."
  • Verify Version: If there is a mismatch between documentation and the behavior on your system, ensure that the version you are using is the same as the documentation. Check this box if they match or the issue you are reporting is not version specific.

Links

https://learn.microsoft.com/powershell/scripting/dev-cross-plat/performance/script-authoring-considerations

Summary

The section Avoid repeated calls to a function in PowerShell scripting performance considerations hits a good point. But there are quiet some situations were it is needed to (re)use the specific code block at several locations in a script as well, which leaves a dilemma:

  • Should I create a quiet expensive function for a easier manageable DRY code, or
  • Should I go for performance and copy the concerned piece of code block at several locations?

Therefore, I think it is good the supply a few alternatives to the expensive function calls.

Details

No response

Suggested Fix

No response

@iRon7 iRon7 added issue-doc-bug Issue - error in documentation needs-triage Waiting - Needs triage labels Mar 13, 2023
@michaeltlombardi michaeltlombardi changed the title Reusing code Expand on code reuse practices and considerations when scripting Mar 13, 2023
@michaeltlombardi michaeltlombardi added issue-doc-idea Issue - request for new content area-sdk-docs Area - SDK docs area-conceptual Area - Conceptual articles and removed issue-doc-bug Issue - error in documentation labels Mar 13, 2023
@sdwheeler sdwheeler removed the needs-triage Waiting - Needs triage label Mar 13, 2023
@sdwheeler sdwheeler added the up-for-grabs Tag - issue is open for any contributor to resolve label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-conceptual Area - Conceptual articles area-sdk-docs Area - SDK docs issue-doc-idea Issue - request for new content up-for-grabs Tag - issue is open for any contributor to resolve
Projects
None yet
Development

No branches or pull requests

3 participants