How to know best practices when using AI as a crutch
Posted by Life-Moose7000@reddit | learnprogramming | View on Reddit | 10 comments
I've been currently working at a company that one big thing is the utilization of AI. I've been put into a project as a solo full-stack developer with a tight schedule that really doesn't give me enough to really grasp new concepts etc. I'm a trainee/junior status, so using AI with this tight of a time window really takes it out of me.
I try to do things myself and would probably do alright without AI if the time wasn't an issue. The problem currently is that I have no clue when I prompt AI that the answer is the optimal solution for my case. I can grasp frontend quite well but I'm having a hard time understanding backend/database logic.
owp4dd1w5a0a@reddit
If you can’t take the time to dig into something routinely, the answer is unfortunately you can’t. Learning something requires you to take the time to learn it.
I don’t know what your situation is. My suggestion is don’t sacrifice your entire life for a job.
If you’re getting into work at 8 ish and leaving at 5 ish, take an extra hour or so each day to understand something you did at work more deeply. Have a couple AIs argue with each other or have the same ai argue with itself from separate conversation threads about the best solution and explain why to you with sources, then go actually read the sources. If you read something and you’re still unconvinced it applies well to your specific situation or even just curious about it, get hands on and run your own experiments trying out different solutions and looking at pros and cons of each and maybe profiling some of your code. Leverage stackexchange websites as well to get feedback from real people who know the craft.
If you’re routinely giving this job more than 50 hours per week i wouldn’t recommend sinking more of your life into job/programming related tasks. The thing to do in this case is begin the search for a job with better work/life balance IMO.
Obviously it’s your life, don’t let me tell you what to do, but this has always been a boundary I’ve had with employers, if I was being pressured or forced to work over the typical 40hr work week more than a free times a year to meet a couple to a few well justified tight deadlines, I was looking for a new job without further discussion with management because I was always very direct and clear up front when talking a new job that I would not put up with working regular 60/70/80 hour weeks. I’ve done well enough now that i was able to retire at age 40 through smart and disciplined financial management despite never working for an employer that demanded more than 40 hours on the regular. Now, I write software for fun and am starting up my own businesses that are not programming related.
mkaif01@reddit
If you’re using AI as a crutch, the easiest way to tell you’re going off track is when you can’t explain the code it gives you or debug it without asking the AI again. A good rule is to treat it like a junior assistant—let it generate drafts, but you still need to review, test, and understand every piece before trusting it. Try rewriting parts in your own words, add your own tests, and occasionally solve things without AI to make sure you’re not losing the fundamentals. It’s fine to lean on it for speed, just don’t let it replace your ability to reason through problems.
TransylvaniaBytes@reddit
Honestly, simply asking this puts you ahead of most, who simply copy-paste and move on.
What I'd suggest using for vetting AI output when you don't fully understand the domain yet is to ask it to explain why it did it that way, not just what it did.
If the explanation doesn't make sense or is too vague, it's usually a sign the solution is either wrong or way over-engineered for your case.
For backend/db stuff specifically, always sanity check things like N+1 queries, missing indexes on columns you're filtering by, and whether it's just throwing try/catch everywhere instead of actually handling errors.
You're not supposed to know all this cold as a junior, the goal is just to build a nose for when something feels off, and then dig into that specific thing rather than trying to learn everything at once. Good luck!
subLimb@reddit
Agree. Also use the AI agent's strengths to help you dig into your code and analyze it. The agents are very good at keeping track of what has been done. Ask it to slice up and display your code from different vantage points and different classifications. Have it create diagrams and tables on the fly where it breaks everything down into logical chunks. Then ask it to justify every one of those chunks. Tell it to provide a source from official documentation sources that backs up and justifies all the decisions made.
If you can get very good at this and actually engage with the explanations (with a very skeptical eye of course), you can actually learn some things more quickly than you would have before. The main problem is that as we get less hands-on, we tend to learn less. So we need to invent new ways to learn as we go.
Evening_Phrase4656@reddit
yeah asking for explanations helps a lot, also when ai gives you solution try to break it in small pieces and understand each part - if you can't explain one piece to yourself then probably that's where problem is
Esseratecades@reddit
The great irony of life is that those who depend on crutches unnecessarily, will often need to jump through hoops later.
josesblima@reddit
Sounds like a shit job :/ I think it's a good idea to make it clear to your PM how kong tasks take, specially as a junior, tasks take a long time. You need to research, you need to constantly put a hold on your task to go and learn about areas you're lacking, you need to iterate and fail a lot... Issue with AI is you can ship stuff fast and your PM will start taking that as your base line speed. I don't care if I get fired, I take my time with tasks, when I ask AI I painstakingly copy by hand the code snippets, I take detours often, to read up on concepts I'm struggling with... I also am fairly new to the game, 2 yoe, and in my current project, despite not being solo dev, the senior won't do code reviews despite me asking, so all learning depends on myself. I use my working hours to learn, and my PM has gotten used to my speed as being the normal speed for someone with my experience level.
BeginningOne8195@reddit
Feels like the safest way is to treat AI as a helper, not the final answer, if you can’t explain why it works or tweak it yourself, that’s usually a sign to slow down and dig into it a bit.
flamingos-are-real@reddit
I'm sorry for your position, you definitely shouldn't had just thrown in the jungle like this.
Normally I would suggest you read about the subject. Robert Martin, Martin Fowler, "Design Patterns" by the gang of four. But since you are in a tight schedule, the basic principles are:
Code "style" (this is really important and your future self will thank you) 1. Your future self and your (future) coworkers should be able to easily understand you code, ideally without the need of comments unless strictly necessary (good identifier names may not be enough for complex logic and regex) 2. Avoid comments, since once you've written them, you'll gonna need to remember of updating it whenever necessary. Maybe add your name, the date you've written and maybe some expiration date to ensure if someone crosses it he will know if it is updated or not. And yes, LLMs also forget to update them. 3. Code can change. Always write code in a way the parts that will probably change will be easy to change. 4. Avoid code duplication. It will attract bugs. Eventually you'll update one block and forget to update the other and this will break the application.
Backend best practices 1. Use ORMs to both enjoy you editor/IDE's language feature (it will probably not understand there's a block of SQL in the middle of your code), mitigate SQL injection and automatize changes in the database structure 2. Be aware of the N+1 problem 3. Create database indices for common used filters associated with heavy queries (they are basically a mapping between column values and table rows, so the database can access rows as if it were using primary keys. There's more to it, but that's enough for you to know) 4.
JOINwith subqueries are usually more efficient than plainJOIN5. Validate data in front end, back end and in database (using constraints). The first will ensure UX; the second will improve security, data integrity and facilitate front end integration; the third is less capable but more reliable in securing data integrity. 6. The further from the CPU the operation is happening, the slowest. If you can centralize the logic in the CPU, do it. You can't centralize in the CPU but can in the memory? do it. Network communication is slow, access to secondary memory is slow. Of course speed is not your only concern. If you need a data to persist you'll probably need to store it in a database. But, for example, storing the start date and frequency of an event and generating the actual dates on the fly is usually more efficient than storing each date. Also, if the data takes some time to change, you can cache it to reduce latency. 7. Continuous Deployment. This will make your life as a developer much easier. 8. Write tests for every critical flow in your system. You don't want to be afraid of changing the code and even less unknowingly pushing bugs 9. Don't waste your time with performance unless needed. Code maintainability is the priority.SRE best practices (your future self will thank you once the system is down for god know why) 1. You don't need a full monitoring suite for a small application, but at the very list store your logs in a way you can query using some tool like Kibana ou CloudWatch Logs 2. Maintain at least CPU and Memory usage metrics for every machine you use. The moment the application was killed by OOM, there won't be logs to help you (maybe syslog, but who said you'll be able to access the machine?). Also maintain saturation metrics for your databases like number of connections and cache hitrate.
I guess that's it.
MeLittleThing@reddit
solo junior fullstack who must use a lot of AI, they're going to have a huge tech debt.
I'm sorry for you, you're probably not going to learn much. Without the AI, you'd have learned a lot. If you don't have a human mentor, I suggest you to have side projects, without AI at all