I’m not sure how to ask this as I’m not finding anything about it being an anti pattern or not online.
If you write a script is it better to use arguments or environment variables. And does that answer change as your argument list grows?
Scenario: I have a secret password that is already set into my environment external to my control
I can choose to write a script that passes the variable as an argument foo.py —pass $password
Or I could chose to read the environment variable in the script — foo.py — … os.getenviron(“password”) …
Which is the better practice? Does the answer change if there are a large quantity of variables?
To compound the question let’s say I have a docker container. Do I forward on the environment variable and just use it as an environment variable or do I turn it into an argument?
submitted by /u/woodenducksdontfly
[link] [comments]
from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/3lRejGK