← Back to context

Comment by voidUpdate

4 days ago

Complex argument parsing is something that I'd only generally be doing in python, which is handled by the argparse library. If I was doing it in another language, I'd google if there was a library for it, otherwise write it once and then copy it to use in other projects. Same with loggers.

Depends on how I'm extracting input from a config file, what kind of config file, etc. One of my favourite things to do in programming is parsing file formats I'm not familiar with, especially in a white-box situation. I did some NASA files without looking up docs, and that was great fun. I had to use the documentation for doom WAD files, shapefiles and SVGs though. I've requested that my work give me more of those kinds of jobs if possible, since I enjoy them so much

> Complex argument parsing is something that I'd only generally be doing in python, which is handled by the argparse library.

Yes, I'm referring to argparse. If you had to write a new script every few days, each using argparse, would you enjoy it?

argparse was awesome the first few times I used it. After that, it just sucks. I have to look up the docs each time, particularly because I'm fussy about how well the parsing should work.

> otherwise write it once and then copy it to use in other projects. Same with loggers.

That was me, pre-LLM. And you know what, the first time I wrote a (throwaway) script with an LLM, and told it to add logging, I was sold. It's way nicer than copying. Particularly with argument parsing, even when you copy, it's often that you need to customize behavior. So copying just gets me a loose template. I still need to modify the parsing code.

More to the point, asking an LLM to do it is much less friction than copying. Even a simple task like "Let's find a previous script where I always do this" seems silly now. Why should I? The LLM will do it right over 95% of the time (I've actually never had it fail for logging/argument parsing).

It is just awesome having great logging and argument parsing for everything I write. Even scripts I'll use only once.

> Depends on how I'm extracting input from a config file, what kind of config file, etc. One of my favourite things to do in programming is parsing file formats I'm not familiar with, especially in a white-box situation.

JSON, YAML, INI files. All have libraries. Yet for me it's still a chore to use them. With an LLM, I paste in a sample JSON file, and say "Write code to extract this value".

Getting to your gym analogy: There are exercises people enjoy and those they don't. I don't know anyone who regularly goes to the gym and enjoys every exercise under the sun. One of the pearls of wisdom for working out is "Find an exercise regimen you enjoy."

That's a luxury they have. In the gym. What about physical activity that's part of real life? I don't know a single guy who goes to the gym and likes changing fence posts (which is physically taxing). Most do it once, and if they can afford it, just pay someone else to do it thereafter.

And so it is with programming. The beauty with LLMs is it lets me focus on writing code that is fun for me. I can delegate the boring stuff to it.

  • ha, very apropos example. One of the things I was ecstatic to let an LLM write for me last week was a click cli.

    Nobody finds joy in writing this kind of boilerplate, but there's no way to avoid it. The click API is very succinct, but you still have to say, these are the commands, these are the options, this is the help text, there is just no other way. It's glorious to have tools that can do a pretty good job at a first crack of typing all that boilerplate out.