And trust me, once u google stack overflow enough pretty soon you won’t need to ask anyone how to output a csv
https://stackoverflow.com/questions/66127551/list-of-all-rol...
And then there is the context switch. This is just one little script as part of a larger system where I’m designing an entire system. It’s much easier if I’m already writing out a long set of documentation, diagrams, slides, etc just to open ChatGPT and keep writing English.
Not to mention when you’re juggling a couple of projects and one is Node and one is Python.
And just in case you are trying to gatekeep, I’ve been programming for a few years - let’s just say my first hobbyist code was in 65C02 assembly language in 1986
ChatGPT gave me a specific answer with the command line arguments that I specified and allowed me to specify a list of policies and output the result in the format I needed
Google gave me a code snippet that I had to modify for my use case.
Before ChatGPT, I would spend a lot of time searching on Google for the right API call and the response structure:
Problem: I need a simple Python script that list roles in an AWS account that has at least one of a list of command line specified policies.
Before ChatGPT: I would look up the api call to list the roles (the API service area of AWS is huge), then look up the API call to list the policies for the role and then look up the API call for the “paginator” that pages through all of the results since the API call only returns 50 results at a time.
After ChatGPT:
“Write a Python script that allows me to specify a list of AWS IAM roles that contain at least one of a given list of policies”.
I get “working” code and then I start polishing it.
“Use argparse with required parameters and use a paginator to iterate through the roles”
Again expected results.
“I need the list of ARNs printed out as a comma separated list”.
I copy the code into VSCode, test it, and I’m done.
Later on for another project, the customer prefers JavaScript. I copy the code into ChatGPT, and tell it to convert it into JavaScript. It works perfectly and is idiomatic JS along with proper async/await handling