N
N
NewDevLab2020-05-28 20:22:41
PowerShell
NewDevLab, 2020-05-28 20:22:41

Good parameter naming practice?

I would like to define function parameters in camelCase style, i.e. $nodeName.
I would like that, because local variables are in this style.
But then you need to call the function with the -nodeName parameter as well. tooltip prompts in VS Code. Alias ​​does not fix the issue.
On the other hand, if you call the parameter $NodeName, then you can immediately see the difference between local variables and call parameters. Which is also not bad.
Normal option?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2CHEVSKII, 2020-05-28
@NewDevLab

PS is not case sensitive, so parameter names may differ when declared and called. Personally, I use PascalCase only in the case of parameters of exported functions, in other cases I use snake_case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question