r/code • • May 21 '24

Help Please Automatic generation of repetitive code (Not AI)

I feel like I'm missing something simple.

There has got to be a quick and easy way to generate repetitive code that only has a few changes - such as inserting values from a list. (Very similar to how a mail merge worked back in the day.)

When I try and search for this functionality, I get results for AI code generation. That's cool and all, and they actually work for this, but seems like massive overkill for a simple problem.

If I search for mail merge functionality, I'm getting scripts and specific results for using email, which isn't what I want either.

Essentially, I want a template block of code that has placeholders that will be replaced with values from a list(s) I provide.

I'm guessing there's a specific term for this that I'm just unaware of. It feels like the sort of thing you'd be able to find a simple online tool for.

3 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/angryrancor Boss May 22 '24

Understood. Yeah, I think the pure simplicity, here, may be why you aren't finding anything. More than likely a lot of people have "home rolled" their own solutions for this, but not bothered to make them public.

Maybe a good opportunity to put something out, and have a good chance of getting a lot of stars on Github, free code reviews, and collaborators

2

u/Tychonoir May 22 '24

So it looks like using mail merge extensions in google docs/sheets will do it easy enough, but the extension permissions are WILD....

"Allow this application to run when you are not present"

allowed to "delete all your Google Drive files"

I think not.