Let me give you an example of what I did just this morning. In fact, ChatGPT is generating code in another tab as I'm typing this - GPT4 is quite slow (well, at least it takes longer than my attention span which has been reduced to that of a sea urchin by years of social media and usage of internet in general), especially when you let it create 50 to 100 lines at a time.
I'm working on a specialized ETL tool for geospatial data. In fact, I've had several iterations of this tool over 5 or more years, but for the last few months I've been working on a new version that incorporates everything I've learned about the domain in that time. This conceptualization, the learning of what the tool should do and how all components fit together, is not something a computer can do. I would have to be able to describe it to get a computer to generate it, of course, but I couldn't a few years ago because I was still finding out what it should do to provide the most value. The reason I had several versions is because I kept learning more about what I need it to do.
But many of the boring machinations I absolutely can have a computer do. For example, a part of this tool is a tiny DSL which is basically a way of specifying combinations of parameters with some dress-up. I'd been dreading making a proper parser for weeks, since a) the 'design' of this DSL has fluctuated quite a bit, and b) I'd have to dreg up my knowledge of parsers from the last time I wrote one 10 years ago. So I've been getting by using a combination of regex, split() and some hand massaging of strings.
But this morning, I had ChatGPT write me the biggest part of a parser using three questions:
- "Write a parser in python for the following format: [optional identifier] [open square braces] [either a list of values, separated by commas; or a list of key-value pairs, separated by commas, the keys and values are separAted by equals signs] [close square braces]. The identifier is optionally followed by an 'at' sign, and a qualifier after that. Show me the EBNF and a parser in python that implements this grammar."
- "The qualifier should come before the square brackets, it's part of the identifier."
- "Write some unit tests for this grammar. Include corner cases for all varieties of the allowed input, so with or without identifier, with or without qualifier, with plain lists and with lists of key/value pairs. Include cases for 0, 1 and 3 values in all places where more than one element can appear."
(try it, I used GPT4 but you'll probably get similar results if you use the free version)
The result I got from this has 2 mistakes: in one case I had to swap two tokens in the EBNF. This one I found by reading the docs while waiting for the output of whatever ChatGPT suggested as a fix after me copy and pasting the error message I got. So this was fixed, by me, in a few minutes (ChatGPT's suggestion for a fix made no sense). The second one, ChatGPT suggested a correct fix after I copy and pasted the error message also.
So, ChatGPT gave me a skeleton grammar, complete with the syntax of the library which I had never heard about 2 hours ago. The second of my first three questions was because I gave it ambiguous input, I only thought of that part while I was writing the question and didn't bother to go back and edit it in in the right place where it would have been more obvious. Then I copy/pasted the raw output from ChatGPT in a new file, ran it, I got the issues fixed (in collab with ChatGPT) in 20 minutes or so. This would have taken me all morning and probably all day if I include all unit tests and all other details just a few months ago. How is this not a massive game changer?
Now, I would not have been able to do any of this hadn't I already known what an 'EBNF grammar' was, and hadn't known how to read and implement one. This tool will not replace programmers. It will however eliminate the need for the very low skill ones, and make the rest (much) more productive.