Best coding practices for programmers / vibe coders?

Captaintj

Regular Member
Joined
Dec 28, 2018
Messages
315
Reaction score
209
I am a big time vibe coder and have been building vibe coded apps for a while. Currently working towards a big project and wanted to know what is the best coding practices that I can implement in my AI, that it takes care of the code and doesn't make many big mistakes. I have never had problems in my vibe coded projects and production has always worked quite well for me.

I am looking to learn the best coding practices that applies to all projects, that I can implement in my projects.
 
@Captaintj if you are moving to bigger projects you need to force the AI to keep files small and modular. once a file gets over a couple hundred lines the LLMs start losing context and making dumb mistakes.

using typescript instead of plain javascript helps a lot too because strict typing catches hallucinations before you even run the code. also look into setting up a .cursorrules file if you use cursor, or just a solid system prompt to enforce these constraints automatically so you dont have to keep repeating your setup.
I am currently using Claude code. And yes I am using Typescript. Could you suggest how can I make sure AI doesnt make those dumb mistakes? We enforce max 600 lines per file.
 
the biggest upgrade is making your ai work in small, testable steps instead of letting it rewrite huge parts of the app. keep the code modular, use version control, add automated tests, and always review database, auth, and edge-case changes manually.
 
@Captaintj if you are moving to bigger projects you need to force the AI to keep files small and modular. once a file gets over a couple hundred lines the LLMs start losing context and making dumb mistakes.
This was sound advice last year but it's no longer the case anymore.
 
Write good tests and keep updating and passing them, test in production also, try and break things as often as possible. Its difficult for people to offer you the best advice for your setup, as we are all scattered in the approaches and languages we use since ai came out.

for example I don't use local agents, i use in web copy and paste only. So my advice to me, is always have a good 7-8 sentence prompt that covers the mission ready to remind the ai every so often. Works well for me, but i don't know if you get to type something like that into ai locally, and really how it gets stored to access as regular as what a manual copy and paste would do. So i'm happily working in AI, but i don't think my advice to you is relevant, thats what i mean, everyone using different ides, languages, testing stacks everything is so fragmented now, there is no real common approach.

Just keep building, this probably won't be your first iteration, you might feel its easier to start again on the same project in a week! lol thats what happened to me, i made like 3 crappy pre versions to the one i have now as i can't remember what i done but i goosed up badly. Now i'm clued up with my setup, my current version is defiantly the final.

Test are your best friend though. Good luck.
 
Write good tests and keep updating and passing them, test in production also, try and break things as often as possible. Its difficult for people to offer you the best advice for your setup, as we are all scattered in the approaches and languages we use since ai came out.

for example I don't use local agents, i use in web copy and paste only. So my advice to me, is always have a good 7-8 sentence prompt that covers the mission ready to remind the ai every so often. Works well for me, but i don't know if you get to type something like that into ai locally, and really how it gets stored to access as regular as what a manual copy and paste would do. So i'm happily working in AI, but i don't think my advice to you is relevant, thats what i mean, everyone using different ides, languages, testing stacks everything is so fragmented now, there is no real common approach.

Just keep building, this probably won't be your first iteration, you might feel its easier to start again on the same project in a week! lol thats what happened to me, i made like 3 crappy pre versions to the one i have now as i can't remember what i done but i goosed up badly. Now i'm clued up with my setup, my current version is defiantly the final.

Test are your best friend though. Good luck.
thanks, We are running 9600 tests currently, but I need a bit more indepth ways to improve
 
Back
Top