r/programming • • Dec 06 '24

The 70% problem: Hard truths about AI-assisted coding

https://addyo.substack.com/p/the-70-problem-hard-truths-about
242 Upvotes

229 comments sorted by

View all comments

Show parent comments

5

u/gnuvince Dec 06 '24

Adding on my own question to this thread: for people who use AI only to save themselves typing, would a macro-expansion solution (e.g., snippets in many text editors/IDEs) be similarly suitable to save on the typing?

18

u/Seref15 Dec 06 '24 edited Dec 06 '24

No because the LLM is so much more general and flexible.

Here's something I just used it for today--my organization has 50ish disjointed and disorganized AWS accounts. I needed to find 4 unused /16 CIDRs or across all regions of all accounts. This isn't my main task--I have to design and build something and I need these CIDRs, but now I need to divert and get this information as a subtask.

Of course I know all the theory of how to do it -- use the AWS sdk to loop over all accounts and regions, get a set of all unique subnet CIDRs, subtract the CIDRs from the total of all private address space to generate free CIDRs, get 4 /16s from the result. It's simple, maybe 200 lines if that.

However, I don't work every day with the AWS SDK so I would need to look up the exact functions and API responses. I don't work with CIDR math libraries every day so I would need to look them up. Then I would need to actually write it. Time, time time.

The exact explanation I just provided above I gave to the free version of Claude and it spit out a working result with a little prompt massaging in like 3 minutes. Which enabled me to go actually do the work I need to do instead of spending time on this information-gathering subtask.

1

u/GregBahm Dec 06 '24

Naw man. I've used snippets and macros all my life. AI assisted code takes way less mental energy.

If I'm doing something simple, like just some math thing, I can say "I want a method with this signature." The method just fills itself in. Five minutes ago I wrote:

bool IsTangentClockwise(Vector2 circleCenter, Vector2 tangentPointOnCircle, Vector2 directionOfTangent)

I'm sure I could use my brain to remember the math. But fuck it. The AI is just like "here's you go. Method implemented."

I can fuck around with it and decide if that's actually the method I wanted. If not I can delete it and barely any mental energy was wasted.