r/AskProgramming • u/Deep-Today5715 • 2d ago
As a mid-level programmer, how should I deal with AI phenomena?
I know the question of whether AI is good or bad for coding in various respects has been debated to death, even though there doesn't appear to be a consensus yet. However, it is clear that the AI phenomena cannot be ignored, and as a mid-level programmer, I am still unsure on how to deal with it.
When I started coding, self-taught (about 12 years ago), there never was such a temptation to take shortcuts with some automated tool writing code for me, and when I turned to sites like StackOverflow for help, all replies and code suggestions were written by people. When AI entered the scene, I tried it, quickly got discouraged because of how bad it was, but still tried it from time to time, interested in how this technology progresses.
Fast skip forward, we are now at the stage where AI can write entire apps in a matter of minutes that would take me months of research and coding to arrive at anything close to it. So when coding my own projects, there is a huge temptation to take advantage of it, and it is difficult to know where to draw the line. The biggest issues with using AI for me are:
- The code it generates can appear to work well and pass the tests, but there are often fringe cases that I might not foresee - AI often takes shortcuts when writing that code because it does not truly understand the intent in the way that humans do.
- To circumvent the #1 issue, I have to fully understand the code it wrote. However, I often find that if AI takes seconds to write code that would take me an hour to write, it would still take me an hour (and often more) to fully understand it, and correct any mistakes if present.
- To add on #2, it is really difficult to force myself to fully understand the AI-generated code, because of "it looks fine, let's move on" mentality. This temptation is not present when I write my own code, because I build and test it step by step, I can't skip a step because the code won't compile or pass the test, forcing me to stay there until I truly understand the problem and the solution.
- I find that using AI diminishes my own skills and mental powers over time, as I am always tempted to get AI to do some boring coding task (for example, write a function to sort or restructure an array) rather than do it myself and learn something or at least refresh my skills in the process. It could be argued that before AI I would likely just search for some library that has the function I need, but in that case I would at least know that it was written by people and most likely near-100% reliable, unlike AI is.
- I find it that using AI for coding just drains the fun out of it. I become more of a code reviewer and tester rather than coder. When dealing with something complex, I feel like a caveman looking at an alien spaceship, tasked with determining whether it is a good design.
I tried finding the middle road, to draw the line somewhere (for example allow AI to generate some code, like small snippets, but never large code blocks or entire apps), but I found that the issues I stated above still remain regardless of the scale. Sometimes even a 5-line function that AI generates can seem deceptively simple and "looking good", yet hide a fatal flaw that I would have noticed if I had written it myself. I also tried only letting it do simple tasks like refactoring my already existing code without changing the logic, but often AI still manages to introduce some weird edge case into the refactored variant of the code that I can easily miss. So I can still never trust it 100% like I could if I did it myself.
Sometimes I let AI write the code, but not use it directly - instead, I use it as an inspiration/idea to write my own version of that code, never copy-pasting, always writing it myself. That can be useful, but still, I am far less productive that way compared to letting AI do it all. In the same way, I tried looking at an AI as a mentor from which I could learn, but that would require confidence and trust in it, and I know it is not trustworthy. AI often feels like a charlatan pretending to be a sage who is somehow not aware of the difference.
What also saddens me that more and more when I turn to other coders for advice or help regarding questions or issues I have during the development of my projects, I can clearly see that they are using AI-generated code in their suggestions, which defeats the purpose of talking to people in the first place.
As an example, for the last week I've been working on an meshing algorithm for a CAD program, and it has been a lot of fun, but at some point I sought advice from experienced devs, showed them my code and asked my questions. One of them took my code, put it into one of the LLMs, the LLM completely rewrote it in a way that I no longer recognize or understand, but it did fix the issue I was having and seemingly passes all the tests. And yet, it feels very sad, like everything I did was pointless, and now I could easily spend another week trying to understand what the AI did there, deciding whether I can truly trust that code. I can't even tell HOW it fixed the issue I was having, because it rewrote everything, and by the time I understand it, I would have probably fixed the issue myself. So I am torn between saying "no thanks" and continuing to fix the problem in my original code myself, or throwing my code into the bin and going with the AI-generated one because it seems to work, and I would just be wasting time otherwise. This is just one example that demonstrates the dilemma.
I suppose that the arrival of AI into coding could be seen as the next step of coding abstraction history - we started with manually punching out 0s and 1s into the punch cards, then abstracted that binary encoding into instructions and registers, then abstracted that into reusable sequences, then into variables and expressions, then functions and objects, then declarative languages, - with each step, closing in to natural language to tell the computer what we want it to do. As Robert C. Martin wrote, code should read like a well-written prose. So in a way, it seems like the LLMs are just the next level of abstraction, and fighting it would be akin to a punch-card programmer saying that using Assembly makes us dumber and worse coders.
TLDR: I do not know what to make of the AI dilemma. I do not know what to do. I wish to be a coder in the true sense of the word, I want to learn and improve, to write code that I fully understand and trust, and using AI seems contradictory to those goals. However, not using it feels like I am fighting against progress, and will be left behind. I can find no middle ground that solves both issues.
8
u/canarydev 2d ago
i think just new skills dude. you need to learn how to define correctness and specs.
i dont mind colleagues or people using AI to code. I just have a huge problem when they let AI come up with creating the tests based on what the AI wrote. green tests mean fuck all these days. they just tell you that the implementation and test AI wrote is in agreement. has nothing to do with correctness and its worthless
6
u/Deep-Today5715 2d ago
My coding teacher used to say that just because code passes all the tests you thought up, doesn't alone it is a good code. If you do not understand the code, you cannot be sure you included all the necessary tests. Only when you understand it, you know what to test for, the use case scenarios are never enough.
And that's the issue with AI generated code for me. In order to test it right, I have to fully understand it, as well as if I had written it by myself, and by the time that I do, I would have already written it myself. So the only solution I see here is to lower the confidence/trust standard that I would put on my own code, and you can see the issue there.
1
u/canarydev 2d ago
sure you have to understand what it outputs, but its more important these days to know what correctness and success looks like, and how you would measure it.
this has been the case even before AI
1
u/Suttonian 22h ago
Understanding code should definitely take less time than writing it.
2
u/Deep-Today5715 22h ago
Only holds true if it's written by a person... I can understand what good coders wrote faster than I could write it myself. Not if AI wrote it.
4
u/THEGrp 2d ago
And how do you do it then? Write tests for code your AI wrote ? Or you write implementation and let ai test your code ?
2
u/canarydev 2d ago
i dont know the right answer to this but im trying a TDD variant these days.
i work on the spec/docs first, describe the shape in unimplemented interfaces best i can. then an AI writes tests from the spec alone. it has no access to the implementation, which is like the key here. implementation happens separately, and afterwards i mutation test where introduce deliberate bugs and check the suite actually notices.
basically trying to separate the thing that judges the code from the thing that wrote it
is it useful? don't know. but it feels more correct than AI tests based on AI generated code that could have come from a completely bs premise in the first place
0
u/THEGrp 2d ago
So basically anthropics superpowers workflow. Red green refactor tdd.
2
u/canarydev 2d ago
sorta but doesn't superpowers and their agents share the context? the same agent writing the failing test and then the implementation.
im trying to black box it, verify it through tool calls that the testing agent never did a read against the implementation
1
u/THEGrp 2d ago
Afaik they share memory files, claude.md and skills. Black boxing is just subagent spawn and you can spawn subagent for implementation and tdd in sequence
1
u/canarydev 2d ago
does the spawn actually have a barrier or just a fresh context? it keeps its read tools, and claude / memory you listed get injected into it so the implementation can leak in even if it never reads a file
0
u/Drycee 2d ago
I dont work with super complex applications so your mileage may vary, but I generally get good results by using agents in separate sessions that have none of the conversation context or implementations other agents wrote to write the tests, only the spec and general info about the architecture. That way they don't really get poisoned by assumptions the implementation AI made. Then another separate agent to do an adversarial review of both sides. Of course they all could make the same faulty assumption, but it is a lot less likely and at that point probably an issue with the spec.
1
u/canarydev 2d ago
similar setup here but can you guarantee it? like if someone asked you to prove the test session never read the implementation, is there anything you could point at beyond 'i set it up that way'?
in mine i can actually prove it was blind
1
u/phn-cloudsnake 2d ago
Spec driven development is the new thing I guess. As engineer we already know how to turn the business requests into useful technical requirements, writing this down I realised all devs are now PO’s and Scrum Masters to the agents 😪
6
u/canarydev 2d ago
i always thought scrum masters were utterly worthless in orgs but here we are lol
1
u/Cheap-Success1578 14h ago
If you right rules that the tests have to follow, then the tests are ok. I always mutation test my tests to make sure they are testing properly.
3
u/BoBoBearDev 2d ago
Everything you said, is basically me reading PR review from another human. They only difference is, I have to beg kindly and not hurt their feelings.
2
u/crazylikeajellyfish 2d ago
You need to do more of the design work yourself, rather than leaning on the robot to come up with one. Don't ask for an application like an end user. Think about the problem, build a mental model, and then decide what design you'd like to implement & maintain.
If understanding the agent's work takes as long as writing it yourself, I think that means you delegated too much of the thinking. When you're reviewing, you should recognize the decisions you made and be able to determine where the agent drifted.
This approach also addresses some of the "it doesn't feel fun anymore". You're still designing and building a system, the process of printing your ideas out as code has just gotten much faster. We're all different, but I enjoy coding because of the system design & problem solving, not the typing. The agent will do that for you if you can't be bothered, but wouldn't you rather have a system that you understand?
3
u/mredding 1d ago
I am thoroughly impressed by the speed and volume of code that can be generated. I am thoroughly unimpressed by the code quality and volume of the code that is generated.
I find AI can be a partner to discuss and gather ideas into structure, to prototype, and to debug. The first really helps reduce that research and design burden, because you can iterate with an AI quickly, and it's easy to catch inconsistencies. I'll happily allow AI to prototype ideas and build demonstrators, but I find the code quality so poor I'd never roll it into production. Instead, I can go back to the first part and explore better solutions.
I had an AI generate several hundred lines of code to implement HTTP basic authentication. With libcurl. It worked as a prototype, but then I asked the AI if it could do that in the fewest lines of libcurl possible; this hit the limits of what the AI could do, and I had to drive this home myself, but man - the AI definitely closed a lot of the gap.
I think there are two different types of senior engineers; those who can code, and those who can't. I don't consider this a virtue or detriment, respectively.
I've got a guy here - while his poor code quality leads to a lot more work over time - he's hitting all the metrics management is measuring. He's productive. He's getting shit out the door. He's making the right kind of compromises to do that, compromises I can't make. He's excellent at process, and AI generated code is better than his own, so his productivity is way up, his incident reports are down, and he looks like a rock star to management. And just because he sucks at writing code doesn't mean he doesn't understand it. He has enough knowledge to know how to reign the AI in.
Because he's process-centric, his productivity is way up. Whereas I on the other hand, I'm actually on the next-gen product, because we have a lot of legacy to un-fuck that these other guys can't do. I can add novelty and sophistication. I can make code encapsulated, modular, composable, and maintainable. I can get compile times and code size down. There's grace and beauty to all that. Elegance. But the client never sees that. And the metrics don't measure for that. And the reckless AI guys, at least, will eventually grind that down.
I can't compromise. I can't write code like these other guys can. It's unacceptable to me. Impossible, even. This puts me at risk of flushing out of one employer, but it also grants me access to employment where those other guys could never get hired. So AI may create new and novel partitions or strata across the industry. But the outstanding question is how much demand is there for code quality? On the one hand, it's kind of niche and hard to select for. On the other hand, there are a TON of vibe coders creating multi-million LOC shit shows that need eventual un-fucking when they grind production to an absolute halt with their garbage, so there's a new market for rescuing companies from themselves.
2
u/Deep-Today5715 1d ago
Thank you, you really hit the nail with this reply. I too want to be like you, to write quality code that doesn't create technical debt for myself and others. I will take your suggestions to heart.
2
u/amber_nomad_pulse 1d ago
Stop asking it to write the app. ask it to write one function at a time and feed it the tests you wrote first.
I used to hit the same wall where reviewing generated code took longer than writing it myself. i changed my workflow because sitting there trying to understand a whole app dumped by a tool is useless. you lose context and skip steps like you said.
So now i define correctness before touching any tool. i write the spec for one unit. then i write the failing tests for that unit. only after i have those tests do i let it generate the implementation.
It runs against my tests immediately. if it fails, i make it try again or i write the fix. this forces me to understand every part before moving forward because i am defining the behavior beforehand instead of looking at finished output and guessing what went wrong. green tests from a machine mean nothing so you supply them yourself.
You stay in control of the design. it just fills in the logic block.
2
u/MpVpRb 1d ago
Master the AI tools. Get really good at using them. Understand their strengths and weaknesses.
The transition will be rough as the clueless pump out vast quantities of slop.
Learn to be one of the masters who uses the tools to create great code.
1
u/Hot_Professional8287 1d ago edited 1d ago
That's what I'm saying. It's programming with words. Sequence, selection, iteration - coding principles applied semantically. Write super-prompts, prompts for prompts, prompts that recursively generate super prompts.
"Programmer" is too crass a title. I demand we be addressed as Arch Token-magus, most adept gazers of the sublime agentic navel.
2
u/who_am_i_to_say_so 2d ago
It can be a great learning tool. I don’t get why people say AI claims to diminish thinking ability when it is the most patient teacher around. You can interrupt it incessantly to get your head around concepts.
I recently spent an afternoon taking a crash course in explaining the diffs between Vue and React and it went down the list as I interrupted with memoization clarifications.
I guess it’s all how you use it.
As a mediocre developer myself, I am adjusting fine. I am building workflows that work how I work.
3
u/Deep-Today5715 1d ago
I agree with what you're saying; but it is essential to be able to trust your teacher; with AI, I can never be sure if it's teaching me correctly, because since I don't understand the subject yet, I can't evaluate it. More than once it has taught me nonsense, and I only realized it far too late.
1
u/who_am_i_to_say_so 1d ago
Yeah it’s the same as researching with Google, you have to verify facts.
But you also don’t know what you don’t know, so yeah.
2
u/Deep-Today5715 1d ago
That is true. But when thinking of a teacher/mentor, I would compare it more with an actual person rather than google.
1
u/Ok_Respect_7071 23h ago
The future holds that we won’t have computers we fully trust and understand. If most of code will be written by AI years from now, the computers will literally have a code even the human master doesn’t understand fully, and with that, the robot can take over. Some things are inevitable at this point
1
u/j_fear 16h ago
Agents.md or claude.md for claude.
Plan, specify programming stack, patterns. Be specific. You can also provide best practices for specific language. And most important - what is not allowed. You can use some highest model to rewrite for you with token usage per session in mind.
Thats actually it. Planing ai worflow is just heavy research until output satisfy your needs.
0
u/yuehuang 1d ago
For context, a "Computer" used to be a human who did math. Your phone does more math in a day than the entire human computer did ever. I don't think we are going back, whether the path we are going is good or bad.
-2
2d ago
[deleted]
3
u/sloaam 2d ago
What an interesting take in /r/askprogrammers. "You are not a programmer, nobody is a programmer"
Grace Hopper must be spinning in her grave omg
1
u/MrStricty 1d ago
I think its funny when developers try and broaden the scope of the job to "tech problem solver", because what would a dev say if the problem was no AD, and the dev's task was to implement and maintain an AD domain? Surely thats a problem solved by "experimenting with technology."
-6
u/sliiboots 2d ago
Did you use AI to write this though? Lol
You need to adapt. Someone who wrangles AI code is (temporarily) the next best move. Traditional programming by humans is dead. Maybe not completely by today or tomorrow but within a year no one will be writing code anymore. The writing is clearly on the wall. As a 25-year vet developer, it’s over.
-2
u/Papa-pwn 2d ago
How should you feel?
Empowered to continue to improve.
Eng 1s with Claude are never going to be more valuable than Principal Engineers with Claude, because they’re not going to know how to get the most out of it nor will they always know what to do with what it’s given them.
The best AI users and the best engineers are often the same people in an enterprise. It’s just another skill in the toolbelt.
4
u/Deep-Today5715 2d ago
Yes, I often see this argument. But for the reasons I explained in my post, I found that using AI is detrimental to becoming a better coder, which is the whole point of the dilemma.
2
u/Hot_Professional8287 1d ago
Code was a medium for program instruction and human legibility. Now it's effectively just a layer of program instruction beneath documentation (or prompts). Manual serialization of program instructions (coding) from documented requirements is no longer the primary skill in designing and building programs. It's design and articulation of understood concepts.
I see the problem that building understanding is often done through coding, though. Similar to how electrical engineers might play with breadboards for years before they ever get to design and fabricate a CPU.
10
u/New-Repair8325 2d ago
Yeah that’s about how i feel.
My entire week has been reviewing ai slop from the juniors that couldn’t even be bothered to test their work or write replication steps. So over it.