Readit News logoReadit News
Posted by u/register a year ago
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?
simonw · a year ago
I have yet to find a code assistant that's more generally useful than copying and pasting code back and forth from https://claude.ai and https://chatgpt.com

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.

aidos · a year ago
I’ve been playing around recently trying to do a bit of refactoring work with copy pasting in Claude and using Cursor. This week I tried a task where I had a small script that used jquery (one Ajax call and a bunch of dom manipulations).

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?

simonw · a year ago
I treat the LLM like a weird kind of pair-programming partner: I fully expect to have to review everything it writes, and I often prompt it with that in mind - I'll tell it exactly what I want it to write, "write a function that takes X and Y and does Z and returns ..." kind of stuff.

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.

StefanWestfal · a year ago
Not op but a similar experience. I used cursor with claud to generate a small bash script to set up a Postgres container, iterate over local migration files, and apply them using psql. The generated code did all correct but called psql from within the container. Even when feeding the errors back in it could not correct the code or identify the bug.
padolsey · a year ago
I was in in the `concat->copy->[Claude/OAI]->paste` workflow until a few weeks ago. Cursor is a revelation. Nowadays I only very rarely pump things wholesale into Claude[dot]ai when I'm dealing with a massive cross-codebase issue. Otherwise Cursor is my salve.
zackproser · a year ago
Had the same experience. Cursor ux and also Zed are designed to make copy pasta'ing back and forth obsolete. It's certainly more comfortable to iterate within the IDE, for me.
KMnO4 · a year ago
Have you tried Cursor? It’s the process you describe, minus the manual work of copy/pasting.

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)

flashgordon · a year ago
Interesting you mention this. I actually first started with cursor (ok copy pasta from gpt4 doesn't count). It blew my mind away (may it felt this way due to co mparison with gpt). The cmd-k was awesome.

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.

Vanclief · a year ago
That used to be my flow, but I just added Avante to my Neovim and it has been a awesome for working with a single file.

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

paradite · a year ago
I also use this simple workflow. However, copy-pasting can get tedious after a while.

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/

screye · a year ago
Seconded.

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.

ramoz · a year ago
The copy/paste flow is what is most optimal for me. Not exactly what you described but the flow of c/p between VS Code was annoying so I built https://github.com/backnotprop/prompt-tower
dtquad · a year ago
It's also useful as a solution architect. Claude Artifact can do non-trivial sequence diagrams and state machines.
smusamashah · a year ago
Using a chat api client like webchat or betterchat are way more cost efficient than Claude.ai. I use https://web.chatboxai.app/ these days but wish it had some features from betterchat.
padolsey · a year ago
Cursor is incredible. You can use whatever model you like. Give it your openAI key if you want o1-preview. Using it with Claude Sonnet is usually enough though. I use it everyday and it makes it possible to work between dependencies and it can create and edit files on the fly -- pending your approval of git-vibe diffs it presents to you. I've been programming 19 years and it's honestly a life-changer.
elpocko · a year ago
They took open source code and made a closed source, subscription-only product from it with no support for open/free/self-hosted models. No thanks, I'm not gonna support that.
Alifatisk · a year ago
But vscode isn't open-source? It's open-core I believe. I remember trying vscodium but not everything was there that I had on vscode, and that mainly stem from extensions relying on the proprietary parts of vscode.
padolsey · a year ago
Umm it does have support for open/free/self-hosted models through either openrouter or by changing the oai endpoint (as long as you've got an openai compatible endpoint which is usually the case).
prophesi · a year ago
I would switch to Cursor if you could bring your own keys. Products with LLM's these days are costly subscriptions to cover running OpenAI / Anthropic inferences when they could instead give the option for the end user to take on that cost themselves, and from there I can check my own OpenAI / Anthropic console to see if it's worth it.
dtquad · a year ago

    >Give it your openAI key if you want o1-preview.
o1 sounds slow and expensive for the usual AI conversational coding and autocomplete stuff. But it might be the right model for scaffolding of new projects and do non-trivial refactoring s of existing projects.

Does Cursor support setting different models for different tasks?

andix · a year ago
Is cursors performance different to aider?
padolsey · a year ago
Cursor is a fully fledged fork of VSCode so IMHO it's in a different ballpark to Aider/Claude-Engineer/etc. Its LLM assistance is baked in to the IDE. Feels really comfortable. I switched over from SublimeText after a decade.
Alifatisk · a year ago
It feels more responsive compared to vscode, but I cannot say that is the case.
joshstrange · a year ago
Custom IDE is a non-starter.
ctoth · a year ago
I've had lots of luck with Aider, and it continues to get better. Another cool thing about Aider is that it is mostly written with itself[0], and so it's an example of a flywheel just as was predicted.

[0]: https://aider.chat/HISTORY.html

ChicagoDave · a year ago
I’ve been working on a complex game engine in C# 8 using Claude 3.5. I’m using Visual Studio so copying artifacts from Claude to VS, then replacing uploads in Claude is a bit of a chore, but does provide good results.

There are definitely instances where Claude can’t solve a problem and I have to hand write the code and explain it.

It definitely gets confused with designing multiple modules together.

But there are times when it’s simply brilliant. I needed a specific inheritance pattern and Claude introduced the curious recurring template pattern, which had escaped my career. It’s not something I’d use in business code, but in this use case it was perfect.

Claude also helped me build a bi-directional graph to host my game world.

And Claude is phenomenal at unit testing whole projects, allowing me to find design flaws very fast.

My overall experience is that if you know what you’re building, GenAI can be extremely powerful, but if you don’t, I could see both good and bad results coming out.

The lessor experienced developer using it won’t know when it should direct the process in a certain direction and more senior developers will.

wkirby · a year ago
I’ve yet to find any LLM that adds value instead of noise. Even the boilerplate you’d hope it could knock out easily is often subtly wrong or outdated.
andix · a year ago
Exactly my experience. Fails on the most basic tasks by introducing subtle bugs. It feels like you're passing tasks to that one junior developer that copy&pastes something from stack overflow instead of solving the problem.
simonbarker87 · a year ago
I find that if I explain what I want and if I were speaking to a first day on the job junior then it produces code like that of a mid career dev.

As always, the requirements planning and communication is the hardest part of coding.

jitl · a year ago
Cursor’s model of select text -> cmd+k -> type instructions -> enter makes it quite versatile and useful for lower level transformations that I’m previously use vim regex find/replace to do. It’s also great for pretty formatting table layouts strings and such; kind of stylistic changes that not even regex helps with. Those use cases it gets right all the time, but they aren’t worth doing if it involves several steps copy-pasting code from your editor to the LLM app/page, so that’s why Cursor really shines.
wkirby · a year ago
I just can't bring myself to expend the resources that a modern LLM requires for something 10% better than the LSP refactor commands.
pawelduda · a year ago
I once spent an hour on a back and forth conversation with cursor on a boilerplate for a tedious task (I provided a working example). Then the next 2 hours fixing it because of sheer amount of subtle bugs and misplaced values.

Maybe 1 out of 10 chats was actually time-saving

bearjaws · a year ago
https://aider.chat/

Only uses CLI, so you have two contexts you work in. One is you manually writing code just like you are used to. The other is a specific context of files that you inform the LLM you are working on.

By creating a separate context, you get much better results when you keep the tasks small.

Specifically use it with claude 3.5 sonnet

mistercow · a year ago
Copilot’s main thing is to be autocomplete on steroids, so I’m not sure what exactly you’re looking for. Cursor’s Copilot++ is able to make more complex edits, which is good in boilerplate heavy situations, but it’s not as good at inline completions. I use a combination, flipping copilot++ on only when I’m doing rote migrations and refactors.

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.

tetha · a year ago
Hm, are other AI Assistants much more than just a bit fancier autocomplete?

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.

register · a year ago
My experience with Copilot's productivity estimates differs significantly from these figures. As someone who rarely consults Stack Overflow, I've found their estimates to be exaggerated. During a recent 2-hour coding session (yesterday), I found Copilot's contributions to be minimal. The only substantial benefit was a single autocomplete suggestion for a unit test, which saved me approximately 5 minutes. While this may seem insignificant, it represents a mere 4% time savings in a focused coding session.Interestingly, I rejected at least 70% of Copilot's suggestions during this session. Most were either obvious or didn't align with my coding style. Your estimates appear to be based on scenarios where developers frequently consult external resources like Stack Overflow. Given that I don't typically seek help from such platforms, these estimates do not reflect my experience at all.
vbezhenar · a year ago
For me Copilot saves a sizeable chunk of coding time. That said, it might be because of my style. I often prefer writing repetitive dumb code, so Copilot fits perfectly, auto-completing obvious code which still must be written. Before Copilot I often used things like vim macroses, regex search&replace, multiple cursors and so on, but of course they take more time that hitting "<Tab>". At the same time Copilot is very smart at getting patterns and in my experience absolutely reliable, it never makes simple things wrong.

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.