Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
@laserkittens and @dmckee has already provided good answers, and I will not copy what's there. Personally, I treat cli arguments as the default choice because of the flexibility it gives to scrip...
Answer
#1: Initial revision
@laserkittens and @dmckee has already provided good answers, and I will not copy what's there. Personally, I treat cli arguments as the default choice because of the flexibility it gives to scripting. Only choose user input when it's obvious that it's necessary. A good case where you would like to have a combination is a program where unexpected things may happen during execution that requires user input. Like this: $ rm file.txt Are you sure you want to delete file.txt? (y/n) In this case it's good to have this, but in that case also give the option to pass a parameter that adds a default option. So do it. In other cases this can be quite tricky $ myprog file.txt file.txt could not be accessed. Please specify another one: This would be very tricky to convert to parameters.