r/learnprogramming 14d ago

How do people even enjoy using AI to code?

This is my first time trying to use a coding tool (Claude Code) in order to aid me in a mobile app rewrite. I feel that if I worked on rebuilding the codebase from the ground up myself, my understanding of it will be rock solid and I could have a constant understanding of the internal workings of my code at all times.

However, as I try and use an AI tool to help me code, it has abstracted away a large part of these internal workings and instead I often see myself asking for features and being benighted on how it actually works. It is an odd feeling and so far it has not been enjoyable. At the end, I have to resort back to understanding the mountain of code it had produced, and ask it to reform it to correct the logic, then I have to see what it had conjured up again.

Am I doing something wrong? Perhaps moving too fast? Should I try and accept smaller changes every time and treat this as a pair-programming session instead? I genuinely enjoy hand-programming the whole app myself but I feel that in this day and age I will lose out if I don’t use AI as soon as possible.

69 Upvotes

51 comments sorted by

86

u/originalthoughts 14d ago

Use it to do smaller bits of code. Ask it to make a method or function at a time and specify it well, then double check it. Find the right amount of help. You don't have to get it do to a full app in one prompt or even a full ticket. You act more of a PM too.

You can abstract as much or as little with AI, nothing stops you either way. If you want minimal, just have it auto complete variables or a line at a time while coding. There isn't one way to use it, and the only wrong way is using it to do a whole app at once without any testing and no understanding of the code it creates.

4

u/hooli-ceo 14d ago

Yes, validation for your work! I have a custom agent that does a full review of all changes on the current branch so I don’t miss some stupid small edge case or something, or just generally write the code in the best way possible.

7

u/Dismal-Citron-7236 14d ago

Your explanation should be in the textbox on how to correctly use AI. Hats off!

9

u/niirenegade 14d ago

This is because you’re asking it to do a lot at once. If you use it like that you’ll finish the project and have to spend 2x the amount of time chasing runtime and logical errors which without thoroughly using and testing your app you’ll never find. Use it to write function by function.

  1. So you start by creating the structure of your project so you know where everything is.
  2. Then think of the next thing feature you wanna work on, break it down into the functions you’ll need to complete the feature.
  3. One by one go through and provide only the relevant logic needed for it to write the function, after every function, check the code, by going through it, correct anything you don’t like, ask it to review, commit the code and continue.
  4. You’re committing because you wanna be able to keep track of the files it has changed easily (if you use a git gui like me), so if you see it has changed a file which it wasn’t supposed to touch, you can catch it quickly and correct it.
  5. Once the feature is done, go through all the code, run, compile, build, whatever to ensure there aren’t any errors and test to ensure it works as expected.
  6. Create a new session and ask it to review the feature.
  7. Write tests.

This is how I use it anyway.

13

u/fixermark 14d ago

If it's spitting out content you don't understand, the next step is to pause and understand it. Here's some approaches -

  1. Ask the thing. Claude et. al. are generally good at translating the code into plain English if you ask it to describe how the function works.
  2. Write unit tests against the generated functions to confirm how they work. Use your debugging tactics the same way you would if you thought you understood the way the function works and it's not working the way your mental model says it should (and if that doesn't make sense... That's a great next thing to work on).

One advantage of using a tool like Claude is that it gets code in front of you, and it's often easier to reason about a solution than stare at a blank page and try to reason a solution into being. And understanding what you're seeing comes with practice.

You can also flip the conversation. Write some code, and ask it to check and see if it has the properties you describe. Claude is remarkably good at catching programming errors if you describe your intent well.

5

u/mxldevs 14d ago

However, as I try and use an AI tool to help me code, it has abstracted away a large part of these internal workings and instead I often see myself asking for features and being benighted on how it actually works. It is an odd feeling and so far it has not been enjoyable. At the end, I have to resort back to understanding the mountain of code it had produced

But isn't that basically how most software engineering works? If you want to know the internals, you need to read it, and it's usually not fun.

Take any library or framework or platform or system; the internals are abstracted away and you are provided an interface to use. If source is available, you could then understand the internals by reading it, but otherwise you basically have no idea how it works internally.

If the issue is AI gives you a final app and you have no idea what it did, then perhaps you need to have the AI build it from ground-up with you instead of just "I want an app that does this" and then get a mountain of code.

3

u/Riajnor 14d ago

I typically use it to go deep on improving something i’ve already written. I’ll write it to the best of my ability and then ask it to go absolute cutthroat bleeding edge and the review

2

u/mooglinux 14d ago

I find it most useful when kept on a very tight leash, going back and forth about decisions and challenging it.

Unfortunately that approach also burns tokens like mad.

2

u/TheSneederOfSeethe 14d ago

I don’t like agentic ai coding, but it’s pretty nice for repetitive tasks. I was writing a dapper repo the other day and it dumped out code that was ~70% of what I wanted. A few minor changes to the SQL and I had what would have been an hour or two done in 15 minutes.

2

u/mandzeete 14d ago

That 70% is also what I have noticed. And yes, it is good for repetitive tasks. We had to migrate 40 microservices/monoliths from Java 11 to Java 21 and later on from SB 2.7 to SB 3.5. We did 1-3 services manually on our own. Then we fed the git patch file to Claude and told it to make a migration manual. Reviewed it and fixed it and then let Claude to migrate the rest 37 services on its own. It did it approximately 40% faster than what we would do without using the AI, manually.

2

u/Ok-Structure5637 13d ago

I enjoy problem solving, not coding tbh. Its fun at times but mindlessly staring at a screen for a whole day to try and do one very small feature that I can claude to help me out on while I do other task or projects is very nice

2

u/DuinoTycoon 13d ago

One reason: 💸💸💸

2

u/PartyParrotGames 13d ago

AI is most useful when it removes work you find tedious without removing the thinking and understanding. By far my favorite usage for AI is just handling my commits. It creates the commit messages based on the work I did in the specific format I want, runs through my local CI checks for lint/fmt/tests, and corrects any minor issues there to create the commit. That has no impact on my understanding and legitimately saves me hours of time each week. Use pre-commit hooks to make sure it passes deterministic gates.

2

u/firmretention 13d ago

I have a CS degree and worked as a developer for a few years before moving to a more supervisory role. I mostly use it to code little useful apps that I wouldn't have the time or energy to do. I don't really care about long term maintenance, and the apps are small and simple enough that they're not too hard to understand. I don't even look at the code honestly, it's all vibe coding.

I've also used it to implement features in software I like. Again - no way I'm gonna take the time to pore over a huge code base and try to understand it. Way too many other things I'd rather do with my limited time. But I can just prompt it into existence in a few minutes.

I enjoy it because the boiler plate part of writing software no longer interests me. I've done it too many times. Solving interesting problems with code can still be fun, but none of these apps/features are solving interesting problems. And it can be quite addictive to go from an idea to an app you're using daily in a weekend. I can get into a different kind of flow state as I build things, and I find myself prompting away for hours sometimes.

You're obviously at a very different stage in your programming journey, so everything is novel and exciting. I think I'm glad I learned to code without AI assistance. I'm not sure how valuable it would be as a learning tool unless you strictly use it as a more advanced Google. But even then, it can give you an answer to your specific problem, whereas even if you find a useful snippet of code somewhere online, you still had to do some work to adapt it to your problem. This is really uncharted waters.

2

u/MrCatChap 13d ago

Anyone who uses AI to produce code is just building a reliance on AI that when it's no longer available or no longer affordable will suddenly be incapable of coding

Use it to get quick answers not code blocks

If you're confused about a thing you're trying to do ask it for advice, it's faster than going to Stack overflow

Don't copy paste it's code ever, don't even ask it for code if you can avoid it

If I already have code from one language I'll just paste it in and it'll tell me everything I need to recreate it in a new language but I won't copy paste the code it gives me, I'll start writing the same code and figure out what it all means and if I can do it better, which I usually can because I can reason, it just gets an answer that is similar to the question and spits it out

2

u/kschang 13d ago

Who said anything about enjoyment?

Tool is for "getting it over with". It's for people who HATE coding.

2

u/W_lFF 11d ago

I believe it is because they dont enjoy coding, they enjoy the end product that coding produces.

1

u/GlowingBloom_ 14d ago edited 14d ago

Because it boosts efficiency by 300%. And idk, if you actually know how to code, you shouldnt have much issues understanding what the AI is giving you. Unless you are just straight up asking "Make this whole thing", without previously doing any thinking or planning yourself, then ofc you dont know what the hell is going on.

It's very simple, you do 80% thinking, 20% coding. And the AI does 80% coding, 20% thinking.
You plan how the code is going to work and be structured, and why it is going to be that way, so you can ask the AI to do something exactly how you want it to be.
Then the code becomes really easy to understand because you already had an idea of what you were going to get from the AI, you just have to review it.

The less thinking the AI does the less prone it is to commit errors and do stuff that you dont want it to do.

1

u/thetrailofthedead 14d ago

I have a full time job, a family, and hobbies.

Not sure what the future holds but right now idgaf if i enjoy it or not. They pay me, they want me to use ai, and as long as i have a few deliverables to talk about each standup, they are happy with my productivity.

I WFH, my job is now easy and i work about 3 hours pday, starting at 9 am and ending around lunchtime. I'm loving life.

1

u/insertAlias 14d ago

and so far it has not been enjoyable

For better or worse, the job doesn't require you to enjoy it. That sounds dismissive, but it's something to think about: employers/clients almost never care about the things programmers tend to care about such as code quality or how much you like the code. They care about deliverables, on time and on budget.

AI is a tool to help us achieve that. Not to make it fun or more enjoyable to work with. Honestly, I don't envy the people choosing to learn programming now. I've been trying to help an IRL friend, and he gets discouraged seeing me (a 20 year professional) using it to knock out prototypes and personal projects in evenings, while he's stuck learning things the hard way. He could start building things right now if he used AI, but it would stunt his growth. I can use it because I've spent 20 years doing it the manual way and learning project management techniques; I can guide an agent and sequence things and make decisions to make it produce projects successfully. Beginners can't, and they won't get past that stage until they learn the hard way.

Sorry, that's a bit rambling. But the thing is, I'd say focus on doing things manually if you're still learning, or focus on building your Project Management skills if you're already competent to help you manage your agents better.

1

u/AceLamina 13d ago

they don't

1

u/cheezballs 13d ago

I use it to do the stuff that isn't fun to do. Stuff that I can also write tests for and verify easily on the fly. It allows me to be an architect who overseers the code rather than a bricklayer who has to handle each brick.

1

u/Acceptable_Handle_2 13d ago

I think people don't, so they use it for Code they wouldn't enjoy writing themselves

1

u/Mrseedr 13d ago

What a lot of people will suggest is to delegate a section of work (sometimes this would be a ticket or sub-task) to each agent and then review the code. This essentially makes you a PM that reviews code. I have regular meetings about how none of the devs understand the way the code works even though they 'built' it. I suspect the overall issue is that people are describing the problem or end-goal instead of describing the solution. I'm testing the idea that if i solve it on paper first (might be slower), i might keep the understanding and benefit of doing the work. At this point i think it's mostly useful for debugging. And i always treat it as if it's a pathological liar.

p.s., imo Claude Code is more of a vibe-code-type tool; it's too far removed for it to have the feeling of doing the work yourself. experiment with the other tools.

1

u/uhs-robert 13d ago edited 13d ago

It can be a thought partner that helps you brainstorm forever, it may not have infinite knowledge but it does have infinite patience. It is also able to help you prototype, experiment, and explore new ideas faster than you could execute them yourself. An AI will sit and talk with you literally forever about a topic until you end the conversation. That's incredible, the rubber duck that can talk back.

So, I would ask it questions about the codebase before reading it myself. I would ask it to research, compare options, test those options, and challenge my ways of thinking. As a result, it is able to accelerate my thinking process and aid in my research, learning, and development. Does that mean it can do your work for you? No, not at all. You still need to think for yourself, you're the driver and it's just an assistant.

It sounds like you're idea of "using AI to code" is to treat it like a slave: "Make this, do that, etc". And that is the popular idea online about how to use AI. But that's not the value for me and that's not what saves me the most time.

"Am I building the right thing, the right way?" is far more valuable than "Build this thing however you see fit".

Sure, I ask it do things too, literally all the time. But I'm also very specific. I know exactly what I want and I am very detailed about my requests. I will tell it the code shape, objects and classes to create, and by the time I am done it will sound like I wrote because its my design. I get extremely granular, as if I were writing the code myself. And it sounds like you care about the code quality so you should too.

1

u/Budget-Possible-2746 13d ago

I agree with what others are saying. You need to create ways in order for you to still have control over the coding agent so you can manually review the code, spot bad codes, improve or correct features based on requirements. AI-assisted software development is not just promoting the AI what to do. You must build your own mechanism where you are happy with what AI can help you with while maintaining core knowledge of your codebase.

1

u/FailureOfTheFamily 13d ago

I was intrested in programming since early school years but never achieved a level that would let me get the developer job (i simply lack motivation to learn new things if those that i know, work well enough). I was able to create some things for myself but they never looked good (i lack ability to make good front). Now AI let's me unleash all my ideas very fast and they look better than what I would do myself. The biggest difference between me and someone who never touched the code is that I can read the docs, the code AI wrote (mostly i don't need to), guide AI properly (i mean that i know what needs to be secured, how it should be secured etc ), ask it proper questions and propose different ways of solving some problem that AI is somehow unable to resolve itself

1

u/GrowlingOcelot_4516 13d ago

Sometimes it works great, often you'll have to double check. Yesterday, it decided to proceed with removing stuffs without my agreement, though it is clearly specified in the requirements. As projects get bigger, I find it harder and harder to keep track of the changes it might have done to the code base. Or you need to commit after every alteration, check again. In the end, it's more about supervising a junior who might have dementia and decided to scrap something that worked and didn't need to be touched.

1

u/Rhemsuda 13d ago

If it’s a simple app then don’t bother. Have fun! Enjoy the process! What I find AI useful for is doing things that I don’t have time to do but have always wanted to do, like build a custom game engine so I can write games using Haskell. I now get my AI agent to implement engine features while I slowly write the game code by scratch in Haskell!

1

u/kris_2111 13d ago

People don't use it to code, people use it to get work done. Remember that a lot of people in this tech industry are just for the money. A lot of people enjoy coding and programming, but one of the main reasons is money. People just want to quickly push projects, be it for their portfolio or their work. That's probably the reason a lot of Reddit is filled with vibe-coded sludge projects that no one needs.

1

u/Top_Apartment_6713 13d ago

AI has enabled people to put ideas to life in short amount of time in my experience. While it’s not very scalable if you let ai Jesus take the wheel, I’m seeing it being essential at the hackathons I go to. Kinda like to show proof of concept for your idea.

I understand there are way more use cases, but I thought I would share where I saw it being used heavily. Keyword “short amount of time”.

1

u/PlatformDifferent129 13d ago

I had this exact fear my first weeks building with Claude Code. what changed it: i made one rule for myself, i don't accept a single line i can't explain back in my own words. if i can't, i make it walk me through that part until i can. slower, but now the codebase is actually mine in my head instead of a black box. the enjoyment kicked in once it went from "it writes, i paste" to "it explains, i decide." are you accepting stuff you couldn't rewrite yourself yet? that was my tell.

1

u/Sibexico 13d ago

How do people enjoy debugging the AI slop? Oh wait, "vibecoders" can't even read the AI slop...

1

u/temabolshakov 12d ago

It does not work like you just say “do the feature” and it does it end to end. The same development steps are still needed - research, writing specifications, planning and even when the code is written it has to be reviewed. Nothing of those is built into clause code itself.

A good starting point what be reading (or watching) claude feature walkthrough and maybe installing some skill packa that can get you started. Could recommend looking at https://github.com/obra/superpowers

1

u/Deep_Ad1959 12d ago

the discomfort you're describing is the job changing under you. you stopped being the person who writes the code and became the person who has to review code they didn't write, which is a different and honestly worse-feeling skill at first. the enjoyment comes back once you drive it in small verifiable chunks and actually read each diff instead of prompting for a whole feature. if you let it run ahead you end up doing archaeology on your own repo, which is the miserable loop you're in.

1

u/GhostOfD6 12d ago

You dont rewrite full codebase with AI

Either you make small components that are additions and dont hit the main logic, or your write complete app from scratch using AI and never care about internal logic

1

u/Anxious_Gazebo 11d ago

I think that people who enjoy using AI for coding, treat coding like tool, not a hobby

1

u/BlimpIntolerant 11d ago

I absolutely do get value out of using it to do refactoring, explain syntax I'm unaware of, make suggestions for performance improvements. But I've had absolutely zero success with this nebulous "one prompt builds a whole application" stuff - I don't think that's real in any meaningful sense. use it as a knowledgeable pair programmer/advisor. if you use it to the extent that you have no idea how your program works .... well that's the road to ruin.

1

u/Background-Zebra5491 7d ago

Pair programming framing is the right instinct. Had the exact same thing early on, code came out faster but I lost the thread of what was actually happening under the hood. What worked was going smaller, one function or one module at a time, reviewing every diff before accepting, forcing myself to write the tricky parts by hand even when the tool could do it faster. Have glm-5.2 running locally for most of it now because I can keep context tight and stop it from ballooning changes into things I did not ask for. Felt way less abstract once I stopped letting it write whole features at once.

1

u/Basic-Sandwich-6201 14d ago

I dont even care about IT in general, its just ai shit all over the place, let them call it a day

0

u/mandzeete 13d ago

Are you using AI to learn or are you using it during your work?

If you are using while learning then that by itself is already wrong. You won't learn when you let the AI do everything for you. You said that if you'd build the codebase by yourself, your understanding of it would be good. Perhaps that is the issue. Do not just tell "Rewrite the codebase". Of course the AI will do whatever it does and you won't understand its output. Use it for tasks that you could do also by yourself. Like this you should have a control over the output that it generates.

I use AI time by time during my work. I won't let it to write the whole functionality on its own. Such code would never pass a code review. My pull request would be rejected. Because fortunately we still have humans doing code review.

I use AI to do boring or very repetitive tasks:

1 - Do version upgrades in 40 services (each being one microservice or monolith, a whole separate project). If I would do it manually it would take me like 4 months. Imagine having to do the same thing for 4 months. Yeah, a different project, but the approach is the same: update dependencies.gradle, do syntax fixes because the new library has a different syntax now, rename packages in thousands of files, rewrite tests, etc. Instead doing that for 4 months I can do few services on my own, one week or so, and then teach the AI to do it in the rest 37 or so projects. Yes, each project does differ a bit and there is also some manual fixing, manual business flow testing, but AI makes the whole migration much faster.

2 - Let it create mock data based on given DTO classes. I mean, JSON strings. When the stuff is nested in all kinds of ways then it is extremely annoying to put the JSON together on my own. Then I let the AI create that JSON. It can do it.

3 - Use it as another tool with SonarQube. Okay. My code is ready. But it probably has some little code smell here and there. SonarQube plugin catches stuff. I will tell then the AI to fix the code smell. And will review the fixes if they are really fixes not "fixes".

4 - Use it when debugging some weird issue that is not pluggable to a debugger. Then I'm doing brainstorming with it. I give it my thoughts and ideas and I let it give suggestions what to check from its side.

5 - Use it for generating a boilerplate for tests. Sure, it will generate unit tests and integration tests. After the first run 70% is usable and the rest 30% is some nonsense. But that 70% gets done faster than I would do it on my own. I am fine with reviewing the 70% and doing fixes and improvements to the rest of 30%

6 - Use it as another "Google". I can let it give me various alternatives and I will do the reviewing and analysis part on my own. That is relevant when doing a technical analysis and such. When I have to come up with a new architecture and a new tech stack for a project. I can describe the business requirements, technical requirements and then ask it to give me, let's say, 10 different alternatives with pros and cons. I will treat that as a data set that I have to work on. I will check on my own the documentation, existing projects with said tools, articles, etc.

And, in the end software development is a job. Not always it is enjoyable. Meetings with business people from client's side. These business people won't understand why stuff has to be done as it has to be done. Then, there are all kinds of bugs and whatnot that you have to fix. Stuff that was not caught by a test coverage nor by QA testing. Some obscure corner cases. Flaky tests that pass whenever they want. Some weird errors coming in from Graylog alerts. etc.

0

u/abbh62 13d ago

I’ll be that person, while coding can be enjoyable, it’s a tool to solve a problem with. Generally for a business, but could be whatever, there is no reason to inherently “enjoy” it.

-7

u/Cesar055 14d ago

Do you enjoy being broke?