Ask HN: Best AI Code Assistant?
I would like to hear the community's opinion on the best code assistant they've tried. Ideally, I'm looking for something that allows experienced backend developers to save time (targeting languages C# and Java) and is good at handling boilerplate and complex requests. So far, I've tried Copilot, but to say that I'm disappointed is an understatement. It's essentially just auto-complete on steroids (when it works), and I don't see any real value. What's your experience?
91 comments
[ 3.4 ms ] story [ 142 ms ] threadi had cursor then ran out of free credit. i had github copilot then found it too expensive.
given i'm a software engineer i'm basically looking for free. a.i. is like the t-shirt of the digital world, as in, i don't care where it comes from, just give me a free one when i use your product.
It's very fast though.
when i want to manual code i use visual studio code.
Kinda different from your specific use case, but should give some hints on which one would serve you best, and is an interesting watch:
https://www.youtube.com/watch?v=-ONQvxqLXqE
llm of choice
https://github.com/Aider-AI/aider
I use Copilot in VS Code as a typing assistant, but for the most part I find copy and paste into the chat interfaces is the most valuable way to use LLMs for coding.
Even more so with the Claude Artifacts feature, which lets me see an interactive prototype of frontend code instantly - and ChatGPT Code Interpreter, which can run, test, debug and rewrite Python snippets for me.
Would recommend using a tool to save your codebase as an upload-able file.
Parent comment (simonw) has written a tool. I use another called ai-digest. Pick any one. It solves the 'my model doesn't understand my codebase' problem.
I found that it was pretty easy to get cursor into a place where it had decimated the file and each tab complete suggestion became more and more broken.
Claude was given the task wholesale and did a reasonable job but introduced a subtle bug by moving a tracking call outside of the Ajax promise and I could not convince it to put it right. It kept apologising and then offering up more incorrect code.
I’d say that the original result was good enough that I could pretty much take it and fix it, but only because I knew all the code and libraries well enough. It was only about 150 lines of simple code and by the time I’d finished I was joking with the team that I could have spent all the time wrestling vim macros instead and come out about the same.
What’s your experience been with correctness?
I've spent so much time with them now that 90% of the time I get back exactly what I needed, because I can predict what prompt will get me the right result.
If I need to do something more high level or that requires multiple files I still copy and paste to Claude / ChatGPT.
https://github.com/yetone/avante.nvim
You can just select a block of code, and tell it to (e.g.) “make this function work as a decorator with graceful exception handling” and it will modify your selected code and provide you with a nice diff to apply in one keypress.
Or you can chat with the LLM directly in VS Code, with every snippet easily applied with a click. It can even catalog your codebase in a vector DB for really easy RAG:
“Create a view that allows premium users to view their billing history”
“Okay, I’ve found a function called get_premium_status in auth/user_profile.py. I’ll use that to create api/user/billing_history.py”
(Which then shows the code it will add or change, separated by file, with the option to apply the change)
Then when I tried plain Claude the delta felt way way too small for me. The eng in me kicked in and I started hacking away on continue.dev + claude3 and the delta was very very little. Plus I could bring in more functionality with extra visibility in my own hacks the way I wanted it (macros) which I couldn't with cursor.
So I built a small tool to streamline this copy-paste process and manage source code context to include in the prompt: https://prompt.16x.engineer/
You probably got the wrong impression from their pricing plan page (https://www.cursor.com/pricing), which only mentions "Enforce privacy mode org-wide" for their $40/user/month Business tier. The point there is that the Business tier enables employees to be forced to use privacy mode at the organizational level. It doesn't mean that you must purchase the Business tier to enable privacy mode yourself.
As always, the requirements planning and communication is the hardest part of coding.
This is very different to my workflow though. Most of the time I don’t really know how the code will look like in the end, it’s a process of trial and error until I have a good solution. I know what to do on a high level, but often I need to read a lot of documentation to find the correct apis and so on.
Maybe 1 out of 10 chats was actually time-saving
If you’re looking for “type in some English text and get fifty lines of code written”, Cursor’s chat is the best I’ve tried. But I’m not a fan of that workflow, so take my opinion with a grain of salt on that.
1) Claude/ChatGPT (copy and pasting back and forth)
2) Cursor
After trying other options like Continue + deepseek-v2, I found that the expense of hosting a bigger local version of LLM is too high to match CodePilot's performance.
Played with Continue + Yi-Coder too - requires a lot of time to clarify requests to generate valid code.
I made the decision to stick with CodePilot.
Does Cursor support setting different models for different tasks?
Even the language server is proprietary, though the protocol is open.
I think open-core is better label.
Cursor took the code and modified it for their product, so it's at least open enough to be able to do that.
I use Neovim, and it’s unfortunate that the plugin isn’t quite as full-featured as their plugins for other editors (e.g. VSCode). It works great for completions, but the “chat” functionality opens in a browser.
Still, it’s well worth the license cost. The completions I get from it save a ton of time, and are often much longer than what I’d get from my normal LSP - and more importantly, they’re generally “correct”.
Don't expect any other offerings to change your mind. We are years away from AGI or anything generally useful in this area. It's only a matter of time until the rest of the world realizes this and stops the hype.
It is meant to be an autocomplete on steroids-ish feature where you will have to read through all the code it generated because at the end off the day it’s a black box you can’t trust.
But for low intelligence easy tasks it’s generally a fine product.
I feel like most AI coding assistants are though.
My only nit is they override common keyboard shortcuts in IntelliJ and VS Code. Like Alt + Enter in IntelliJ.
- Copilot using Visual Studio and VS Code
- ChatGPT Plus / Claude, copy/pasting back and forth
- Cursor, free trial and w/ Claude api key
Copilot was like 30/70 good-to-bad. The autocomplete hijacks my mind whereby creating a mental block at my ability to write the next token of code. The suggestions were occasionally amazing, but multiple times it introduced a subtle bug that I missed and later spent hours debugging. Not really a time saver. I quit Copilot just as they were introducing the embedded chat feature so maybe it's got better.
In Visual Studio, I thought Copilot was garbage. The results (compared to using in VS Code) were just awful. The VS extension felt unrefined and lacking.
ChatGPT / Claude - this is a decent way to get AI programming. Multiple times it fixed bugs for me that just simply blew me away with it's ability to understand the code and fix it. Love it's ability to scaffold large chunks of working code so I can then get busy enhancing it for the real stuff. Often, it will suggest code using older version of a framework or API so it's necessary to prompt it with stuff like "For Next.js, use code from v14 and the app router". There is thought required that goes into the prompt to increase chances of getting it right the first time.
Cursor - ah, Cursor. Thus far, my favorite. I went through my free trial and opted into the free plan. The embedded sidebar is nice for AI chat - all of the benefits of using ChatGPT/Claude but keeping me directly in the "IDE". The cost is relatively cheap when hooked to my Claude api key. I like the ability to ask questions about specific lines of code (embedded in the current window), or add multiple files to the chat window to give it more context.
Cursor does a great job at keeping you in the code the entire time so there's less jumping from Cursor to browser and back.
Winner: Cursor
As a C#/Java backend developer, you might not like leaving IntelliJ or Visual Studio to use Cursor or VS Code. Very understandable. In that case, I'd probably stick to using ChatGPT Plus or paid Claude. I suggest the premium versions so for premium uptime access to the services and higher limits for their flagship models.
The free versions might get you by, but expect to be kicked out of them from time to time based on system demand.
We're using CoPilot at work. When we were evaluating this, the question we asked our test group: How much time does it save you per week? And most people arrived at estimations of like 1-4 hours saved a week, especially when banging out new code in a code base with patterns and architecture. This was a good enough tradeoff to buy it.
Like, I recently got a terraform provider going for one of our systems. Copilot was useful to generate the boilerplate code for resources so I just had to fill in the blanks of actual logic. Or you can just hand it sample JSON and it creates go structs for those to use in an API client, and generates the bulk of methods accessing APIs with these. Or it's decent at generating test cases for edge cases.
It doesn't enable me to do things I could not do before, but it saves me a lot of typing.
Well maybe I wouldn't test my functions with all of these edge cases because that's a lot of stuff to do, heh.
Also I can note, that some languages are just naturally fit for Copilot, one of them is Go with its constant `if err != nil` incantations.
[0]: https://aider.chat/HISTORY.html
(Not affiliated with the company, it was called CodiumAI earlier)