I stopped writing code entirely in 2024. Here are my 10 hints for AI coding.

Alexander Isora 🦄
5 replies
I only copy-paste code generated by AI ✌️🤓 Here are my 10 hints (based on real AI coding experience). Hint 1: if you have a creative task such as code architecture, you want to use so called chain of thoughts. You add "Think step-by-step" to your prompt and enjoy a detailed analysis of the problem. Hint 2: create a Project in Claude or a custom GPT and add a basic explanation of your code base there: the dependencies, deployment, and file structure. It will save you much time explaining the same thing and make AI's replies more precise. Hint 3: if AI in not aware of the latest version of your framework of a plugin, simply copy-paste the entire doc file into it and ask to generate code according to the latest spec. Hint 4: One task per session. Do not pollute the context with previous code generations and discussions. Once a problem is solved, initiate a new session. It will improve quality and allow you to abuse "give full code" so you do not need to edit the code. Hint 5: Use clear and specific prompts. The more precise and detailed your request, the better the AI can understand and generate the code you need. Include details about the desired functionality: input/output type, error handling, UI behaviour etc. Spend time on writing a good prompt like if you were spending time explaining your task to a human. Hint 6: Break complex tasks into smaller components. Instead of asking for an entire complex system at once, break it down into smaller, manageable pieces. This approach teaches you to keep your code (and mind!) organized 👍 Hint 7: Ask AI to include detailed comments explaining the logic of the generated code. This can help you and the AI understand the code better and make future modifications easier. Hint 8: Give AI code review prompts. After generating code, ask the AI to review it for potential improvements. This can help refine the code quality. I just do the laziest possible "r u sure?" to force it to check its work 😁 Hint 9: Get docs. Beyond just inline comments, ask the AI to create documentation for your code. Some README file, API docs, and maybe even user guides. This will make your life WAY easier later when you decide to sell your startup or hire a dev. Hint 10: Always use AI for generating database queries and schemas. These things are easy to mess up. So let the AI do the dull work. it is pretty great at composing things like DB schemas, SQL queries, regexes. Hint 11: Understand the code you paste. YOU are responsible for your app, not the AI. So you have to know what is happening under your startup's hood. if AI gives you a piece of code you do not understand, make sure you read the docs or talk to AI to know how it works. - - - Thanks for reading my post! 🙂 I write about making startups as a solo founder on my 𝕏 and email newsletter. Follow those if you want to learn how to build SaaS and web apps and market them.

Replies

Adrien Forray
For someone just starting with coding and with mostly just the theory as main knowledge would you think that this approach will be efficient? I’m both lazy to figure out all the intricacies and excited to ship fast 😅
Share
Alexander Isora 🦄
@aaddrriieenn you have to learn what AI outputs you. Otherwise, yu will shoot yourself in the leg later 🙂
Share
Ali Anjamparuthi
Thank you so much for this informative post. Here are a few additional hints that may be helpful: Hint 12: Experiment with Different AI Models. Different AI models may excel in various programming languages or tasks. Try using multiple AI tools (like GPT-4, Codex, or BERT) to see which produces the best results for your specific needs. Hint 13: Use AI for Code Optimization. Ask AI to optimize your code for performance, memory usage, or other specific criteria. This can help you achieve more efficient and effective solutions. Hint 14: Stay Aware of AI Limitations. Understand that AI-generated code might not always be perfect. Always review, test, and validate the code to ensure it meets your requirements and adheres to best practices.
Share