3 AI Tools That Make Coding Less Stressful ☮️
Sep 16, 2023 3:01 pm
How often do you use AI to write code?
It has been 3 months since AI exploded onto the scene.
I have used it every day since then.
I see a million posts online that claim "AI is a superpower" then never show you how to use it effectively.
After 3 months of writing code with AI daily – these are the tools I find useful:
I am not affiliated with or paid by any companies/tools mentioned in this newsletter. I am a genuine user of all of them.
Coding Assistants
By far the most useful in my experience. These are plugins for your IDE or code editor that give you a Large Language Model (LLM) trained on code.
It's like having a pair-programmer sitting next to you at all times:
It's important to know what an LLM is best used for.
Good for:
Writing unit tests
Refactoring some code
Anything mechanical and straightforward
Not good for
Generating code from scratch
Always taking the optimal route
Anything that requires intuition and creativity
LLMs are trained on a set of data just like humans. If it never learns it, then it won't be able to figure it out.
When you're using AI to do anything intuitive the goal is to eliminate any doubt. That gif above shows somebody prompting "send tweet with image"and leaves a lot of room for assumption.
Use a more specific prompt:
// A function to send a tweet with an image using the Tweepy library. The image is coming in base64 encoded. Twitter credentials are stored in config('TWITTER_CONSUMER_KEY') and config('TWITTER_CONSUMER_SECRET'). Get the environment variables using the Python decouple library. Return true if the image is sent successfully. Throw an exception if the call fails.
You get the gist. The goal is to leave as little room for assumption as possible. Assumption is the enemy of intelligence. Be specific.
Find the balance between what is worth prompting for and what is worth writing yourself. Sometimes wrestling with AI just isn't worth the time.
You will get a better feeling for this with time.
Don't know what to prompt? (promo)
Not knowing what to do is a knowledge gap. ChatGPT can't help you to know what you don't know.
For anybody stuck – I offer a free course and offer coaching calls for anybody interested.
Tools You Can Use
Cursor – https://www.cursor.so/ ($20/mo)
A full-on AI code editor. It is a wrapper of VSCode with AI built-in. Minimal setup on your end and everything works natively.
Copilot – https://github.com/features/copilot ($10/mo)
The most popular option. When people think of "AI assisted coding" they think of copilot. It is the most mature and the cheapest. It's where i would suggest starting if you're curious. There is a free trial too.
Codewhisperer – https://aws.amazon.com/codewhisperer (free)
Built by Amazon and free for individuals. I don't find it to be as good as copilot but if you want a free option it can do the job.
BetterCodeAI – https://bettercodeai.com/ (free-ish)
If you don't want to install anything but want to try this out, check out this website. You can paste some code, give it some prompts, and it will edit the code for you (then show you a diff of what it did). I use this in a pinch. The app looks tacky and just wraps GPT-3 but it works.
WhatTheDiff
Generate descriptions for your pull request to save you time and keep your work moving.
Nothing super complicated but it works great and saves time. It does great with simple pull requests and writes better descriptions than some developers do about their own code.
In general – AI is amazing and doing things that humans find boring and mundane.
I wish I could use it at work, but it only works with Github and Gitlab. When it comes to your own projects it works great and can save you and your friends time when coding something together.
Gitfluence
Ever get your repository in a bad state and don't know how to "git your way out" of the situation?
This is great for that.
- Explain what you want in plain English
- Get some suggested git commands
- Review the command and run them
Nowadays I know my way around Git, but sometimes I get in an awkward situation. This is great for that.
I know early in my career a tool like this should have been a lifesaver.
Simple and effective.
Some Final Words...
About ChatGPT
Even though you could do all this in ChatGPT these apps provide an extra convenience that just makes things easier.
Plus, I find ChatGPT to be wordy when I want a simple response. Using AI trained on data specific to your use case generates better results than a general AI that has to make a million assumptions about what you want.
Practice your prompts
The more you work with AI – The better you will get. Knowing how to prompt is more important than knowing what to prompt.
Take some time to consider what worked and what didn't. Help AI help you.
________________________________________________
Thank you for reading this week's newsletter.
I appreciate all of you who read to the end.
Book a coaching call with me if you want to chat or have any questions.
Email me at swdlodonnell@gmail.com with any questions
Check out my free course if you are learning to code
Until next week 👋