this post was submitted on 11 May 2024
770 points (99.1% liked)

Programmer Humor

19804 readers
825 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 7 points 7 months ago* (last edited 7 months ago) (2 children)

Stuff like this is really useful when variable names are annoying, or when you have to repeat the same monotonous pattern over a large batch of code.

My favorite use of AI in code so far has been refactoring deprecated feature flags. "Replace enableXYZFeatureFlag with true and optimize the code". Bam, 1-2 hours' worth of crunch work solved in minutes.

[–] [email protected] 9 points 7 months ago (1 children)

If it takes 1+ hours of work to remove a feature flag branch in an area of code, I wouldn't trust the correctness of anything the AI writes and would be super skeptical about anything the humans had written.

[–] [email protected] 6 points 7 months ago* (last edited 7 months ago)

It takes a long time because it hits a lot of files, not because it's logically complex. Also, that's why unit and integration tests exist.

[–] [email protected] 2 points 7 months ago (1 children)

Can you please describe how you do this? I thought Github Copilot can only make changes to the currently open tab? It's been a few months since I've used it, and I've only used the Visual Studio version, which I think isn't as good as the Visual Studio Code version. Has Copilot already gotten to the point where you can tell it to make changes to an entire codebase?

[–] [email protected] 3 points 7 months ago* (last edited 7 months ago)

I do go file by file, but I just copy and paste the same query into each. It also gives me a chance to do a quick review before moving on. It's still a manual process but it's a HELL of a lot faster than manually refactoring.

(I can't give too many more details though since I use proprietary software that isn't public facing)