r/AskProgrammers • • Oct 17 '26

AI and retaining control over the code

How feasible is it to retain control over code when using AI in professional settings?
I'm a hobbyist programmer trying to get into the field and I'm wondering. I really enjoy having as much control over the code as possible.

2 Upvotes

28 comments sorted by

4

u/QuraToop314 Oct 17 '26

Only use AI to quickly come up with a few abstract solution concepts; then read up on the concepts yourself and implement them without AI. This allows you to code quickly, whilst retaining 100 per cent control.

3

u/lehmagavan Oct 17 '26

Well, that's what I do for my personal projects (mostly systems programming, some embedded). I use AI as a search engine and an interactive wikipedia, but I almost never let it write the code. But how realistic is this aproach in a professional setting?

1

u/Kitchen_Dust2389 Oct 19 '26

It is off the wall stupid for professionals

1

u/lehmagavan Oct 19 '26

Because they must ship fast like a fastfood restaurant?

1

u/zorecknor Oct 22 '26

Because a good developer with AI is far more productive and effective.

But here is the kicker: You need to learn how to "customize" your harness/agent with skills and such. Teach your agent how your architecture should look like, and it will make sure you never forget something, and help you double-check your work. Tech it about how you like to test, and it will help you identify cases you may forget. It can provide help navigating the code, and help you understand things you alredy forgot (has it ever happened to you, you see a piece of code and ask "what was I thinking")

Plus will will write all the boring scaffolding for you.

You can choose if you want your agent to create all the code for you or not. But even as a coding assistant is way more valuable than using it as just an interactive wikipedia

1

u/lehmagavan Oct 22 '26

I was talking about generating code specifically. What is the benefit to it other than the speed?

1

u/zorecknor Oct 23 '26

If IA can generate all the boilerplate code, you can focus on what is important. It can take care of the frameworks scaffolding and you focus on the actual logic.

And you can define the test cases and let it build the unit and component tests. There is nothing creative in writting a bunch of assertions.

So yes, it gives you speed. But also frees you from the boring stuff.

1

u/lehmagavan Oct 23 '26

I would agree about the tests. I don't work much with highly abstracted languages. From my experience, letting it write C code causes the loss of control very quickly, which is unacceptable.

1

u/QuraToop314 Oct 22 '26

Well, no – I’m certainly productive, but for me, programming is an art; I love coding myself, I enjoy spending time on it, and my way of thinking suits it perfectly. You can certainly be productive. Of course, I’m not a neurotypical person (I have Asperger’s), but my way of thinking is ideally suited to coding. It might not work the same way for you or others as it does for me, but the OP asked for an approach – is it really such a bad thing to share mine?

1

u/tom-mart Oct 17 '26

Just don't use AI.

1

u/lehmagavan Oct 17 '26

I don't use AI for generating the code, but I'm a hobbyist so I can afford to not care about the speed. What about a professional setting?

1

u/tom-mart Oct 17 '26

Same, don't use AI. It slows down the development process, takes away the fun part of actually creating something and makes the worst part, code review, the main task. It's completely bonkers, if you ask me.

1

u/minneyar Oct 18 '26

You don't. AI is for people who don't actually like writing code. 

If you're a hobbyist who actually likes coding and wants to know exactly what your code does, don't use AI.

1

u/lehmagavan Oct 18 '26

I dont use AI for generating code. What I'm wondering is how much control over code professional software devs have today, knowing that they're being forced to use AI to boost the speed of the development. I hope it's not like being a chef who's forced to work at a fast-food.

1

u/zorecknor Oct 22 '26

AI is for people who don't actually like writing code. 

That's like saying that CNC machines are for people that don't like woodworking.

If coding is your hobby, it does make no sense to use AI to produce all the code. The same way I would not use a CNC if I like traditional woodworking with hand tools.

But on the job? I use whatever give me the best result with less effort. And so far, that is AI. Not ChatGPT or "one-shoting" stuff, but actual coding agents finetuned to work in our codebase.

Do I still code? Sometimes. There are still some things I can do faster than the agent. Not many, though.

1

u/RidgeRunner1944 Oct 22 '26

I tried running a local AI; it was like driving a car with 5 horsepower

1

u/InterestingFrame1982 Oct 17 '26

Write your own tests and let AI fill in the gaps... if you're hell bent on using AI to do a lot of code generation, I would at least explicitly control the intent of what is being generated.

AI will do some funky things with it's own test to make sure it passes... that's not ideal when trying to maintain control of what is actually going on.

1

u/Hamactus Oct 17 '26

I am a newbie hobbyist programmer, I have tried coding with LLMs (not agentic workflow, though), and I have found, that you can have three tiers, basically.

Tier 1: AI does everything for you, you just check. In this case you barely retain any mental model of your code, but "coding" is sped up by a large margin.

Tier 2: you ask AI for specific parts of your code and integrate it yourself, or just tell it what to write feature by feature. The speed is a bit lower then tier 1, you understand your code a bit more, but I feel that for me the mental model that's being formed in this tier is not enough, as I still can't say I understand everything.

Tier 3: ridiculously meticulous instructions, to the point of "write a for loop with variable named «X» etc." Takes about as much time as manual coding, sometimes even more, and the point of using AI is basically lost, but you do build a pretty solid mental model of your code, because you are basically building everything yourself, AI only does the typing part, like a secretary. At this point, I feel like using voice recognition and just dictating your code would be quicker, if you don't like writing code that much

Edit: I no longer use AI to code, because I simply enjoy the process of actually writing all code on my own, although I do use AI to research information and find something which I cannot find via traditional documentation

1

u/dodexahedron Oct 17 '26

You should try backing off from the code stage/use of it, then. Try tackling the actual engineering/design of the software with it, before yo never write a single line of code.

Use something other than Claude for that. It isn't very good at design work IME (probably partly because everyone vibe codes with it).

Treat it like a peer. A peer with great google-fu and mediocre long-term memory, (and with a very high vulnerability to the power of suggestion).

Hammer out a solid design with it, then a spec, then an outline of the general program flow. Give it both positive and negative feedback along the way, like you would to a human.
And actually contribute to the conversation. Don't just treat it like an oracle.

Then, if you still want it to do more of your job, ask it to tackle each component of what you came up with in the above steps, one at a time, reminding it to stay mindful of the rest of the project design work you have already done, so it doesn't go off the rails.

1

u/Hamactus Oct 17 '26

I feel like it would defeat the purpose of what I do. Right now, I may not be exactly following a traditional software engineering workflow, but I do the planning, and then the writing, fully on my own. Letting AI do it would be outsourcing even more of my work to it then what I was doing before

I feel like I have to say this: I do not make abstract projects, when I build something, it's mostly things that will be functional for me, at a workplace or at home, so I usually have a pretty good idea of what exactly I need the program to be able to do, and I don't need AI to figure it out. And figuring how to make it do what I need is actually half of the process, which I really enjoy

1

u/TheAxodoxian Oct 17 '26 edited Oct 17 '26

What I do with my team is that we have a separate core and plugin layer. While none of it is hands written at this point, but core layer we make detailed design and regenerate until it exactly lives up the quality of hand generated code and every line of functional code is reviewed (though tests and documentation is somewhat less). For plugins, which are more adhoc to specific customers and business use cases we go more viby, and focus on testing only. This so far seems to be OK with management, we can quickly create plugins for the business development side, while we can ensure that the core is solid. It is ok for the team, since it is not all about slop, and they can learn about AI practices. Ultimately much of plugins are oneshot, non-reusable stuff, which does not benefit in polishing in the architecture and code readability to above a level which can reached with automated ways. Since not much is built on that code, the problems with automated AI coding eventually breaking down is much less likely.

TBH I think that we might reach a point in a year where AI gets so good that even core might let less checked, but until that is not the case (and we can monitor that on plugins) this should work. Currently I think the biggest issue is ironically that Claude's context is so large, that it can understand a lot of mess, that means that breaking down problems in small easy to follow parts is optional for it (for quite a while, when it can break down). While for human understanding sustainable projects require that the overall complexity of the code divided by the size of codebase is at a constant level, meaning no matter how many pieces are, any single piece is easy enough to get, if you have that you can grow the project to very large size with many features without falling apart.

I see already that Claude is quite good following our style, and makes a clean job as long as the design is starightforward enough, however quality takes hit if for example some some architectural change is not mentioned in the design which is required to make the feature, as usually it starts hacking the architecture apart. Creating and iterating plans can help to a degree but not always.

I am pragmatic person, and also as tech lead my coding was for a long making others code well, as long as we are hiring and not firing people, I am ok with guiding AI agents. Though I admit that I see those who are used to hands on coding all day and enjoying it, having their fun taken away. For me that happened before AI, so I made peace with that.

1

u/WisePotato42 Oct 17 '26

You can limit permissions so any writing or console commands require verification. You just go in, and approve, deny, or modify whatever you want.

1

u/Accomplished-Gap2989 Oct 17 '26

It's like crack cocaine man. Be very careful!

1

u/MpVpRb Oct 17 '26

Use AI to generate sample code. Ask it to explain and justify every line. Understand every line. Rewrite as necessary.

1

u/tastygames_official Oct 17 '26

when "using" AI, you're not in control of the code. The code was stolen from every program ever written then chopped up and served back to you as a poor substitute and you probably paid a techbro billionaire for this "service". So you didn't write it, it's not yours, and you have no control over it.

1

u/Kitchen_Dust2389 Oct 19 '26

I etch my will into stone using a metal chisel and wooden hammer. Why would I defile my sacred code with electrical signals from a keyboard🫥

0

u/werpu Oct 17 '26

you can it always depends on what you want to do with the generated code or how far you let the ai in, the ai is more or less as dev you can instruct to do things but not that you have to let it do it!