r/ChatGPTCoding • • Apr 29 '24 • Wholesome Seal 1

Resources And Tips My experience with Github Copilot vs Cursor

I tried Github Copilot's one month trial for the whole month, and at the end of it decided to give Cursor a try for one month too, since lots of people on Reddit were talking about how much better it was. (Spoiler: I did not stick with Cursor for a month)

For context, I'm an experienced developer, plenty of frameworks and languages under my belt. However, I've started a new project with Laravel, which I'm not familiar with, so I thought this would be a great candidate for an AI assistant. It's exactly the right combination of needing a hand with syntax and convention, but with enough experience to be able to (usually) spot incomplete answers or bad practices when I see it. Here's a few observations I noted down along the way:

  • Neither Cursor or Copilot are great at linking the context of a question to earlier ones, but Cursor seems to be the worse of the two.
  • You have to be a lot more specific and precise with instructions to Cursor, otherwise it misunderstands the assignment. Copilot seems better at inferring your meaning from a short description.
  • Cursor's tone weirdly oscillates between excessive verbosity and terse standoffishness. Sometimes I'll get an overly long boring lecture about the broader topic without any code, and sometimes the whole response will be 100% code with no commentary. It doesn't feel like a natural conversation the way github copilot does. Also the amount of solution it'll provide will be haphazard - sometimes it'll produce a long output that includes everything, and sometimes it'll only give you a few lines of solution and hints at the end that there's other stuff you need to do.
  • Cursor limiting the number of "fast" queries even on the $20 paid tier does make it doubly annoying when it returns a useless answer.
  • Cursor's autocompletion is a trainwreck, it suggests the wrong thing so often that it actually gets in the way. It doesn't seem to even bother checking the signatures of functions in the same file that it autocompletes calls for.
  • I can't see any reason why Cursor has to take over the entire environment by shipping as its own vscode build, when there's plenty of vscode plugins that integrate perfectly well with the editors while managing to just be a plugin. I had several issues getting my existing vscode project to run in Cursor even though it was literally the same project in the same directory.

Because the people recommending Cursor seemed so excited by it I assumed that I just needed to learn to tailor my prompts better for Cursor and use more of its features. So, even though it immediately stuck out as worse on the first day, I still stuck with it for two weeks before giving up entirely. I can only conclude that either the people recommending Cursor over Copilot are doing a vastly different kind of project that I'm working on, or they used some older version of Copilot that sucked, or they're shills.

TL;DR: Cursor's answers had a much lower success rate than Github Copilot's, it's more irritating to use, and it costs literally twice as much.

396 Upvotes

175 comments sorted by

View all comments

Show parent comment

1

u/boscop Oct 08 '24

Ah thanks, I'll try that, too :)

Do you have any more Cursor productivity tips, e.g. for larger refactorings?

5

u/Eunomiac Oct 12 '24

Larger refactorings are tricky, because all LLMs are limited in terms of how much information ("context") they can effectively "use" at any given time. An entire codebase is likely larger than this "context window", so an LLM isn't going to be able to, say, recommend refactoring strategies by drawing from functionality throughout your code.

However, Cursor has a nifty shortcut that makes the LLM _better_ (still not perfect) at canvasing your entire codebase. In Cursor settings (Open Command Palette, type "Cursor", it should be near the top), you can have Cursor create an "embedding" of your entire codebase. This takes a few seconds, but basically what it does is turn all of your code into a bunch of numerical vectors that tell the LLM what's related to what, and how strongly. This takes up much less of that context window, as the LLM can use the embedding to focus on only the most relevant code, rather than the whole codebase.

As for tips:

  • Make sure you've got an embedding of your project (as described above)
  • Pay the monthy registration fee if you can afford it. It's cheaper than a ChatGPT Pro subscription, and includes access to all the same models.
  • GPTo and Claude Sonnet are the two best models for coding ATM. Try them both out, and switch between them every once in a while, see which one you like best.
  • Type `@Codebase` into any chat with the AI to instruct it to review all of your files (as opposed to just the file you have open)
  • The GPTo model is multi-modal and can understand images (I'm actually not sure if Claude is as well; you can test!). If you're having difficulties with, say, getting CSS styling to work, you can paste in a screenshot of your problem as part of your question. (It has no problem reading from images, too --- I often screenshot my problems panel and paste that, rather than copying the messages manually)
  • There's a "long context" mode that you can toggle on, it's somewhere in the chat interface (the devs move things around a lot, I can't recall where it is now). This uses a less advanced LLM (i.e. not quite as smart), but with a much larger context window. This might help with large refactorings.
  • Never just accept what the AI says: always ask for an explanation of anything you don't understand, or if something seems off. LLMs forget things and hallucinate facts that simply aren't true quite often. Also, sometimes a problem is simply not within the LLM's ability to comprehend or solve -- and the LLM will never tell you, it'll just keep faking it. Finding yourself in a loop (i.e. where the LLM says it's making a correction, then feeds back your code without any changes) is a good indicator that this is what's going on.
  • LLMs excel at doing those repetitive, boring tasks every coder hates. Use them to add inline comments and JSDoc headers to your functions, and to write unit tests for you.

1

u/boscop Oct 13 '24

Thanks for taking the time to write such a detailed answer :)

Is it possible to manage the different sources of documentation that I want the LLM to pull in for RAG, so that I can make sure that it crawled all the sub-pages?

Can I also pull in PDFs or other local files (such as txt/markdown) for RAG?

1

u/Eunomiac Oct 14 '24

When you add custom documentation, you enter the URL to the "main page". But there's nothing preventing you from defining a bunch of different documentation types for the specific features you want it to focus on, and give them each a different name. You can also use the @ Web command to tell it to search the web for the most up-to-date information.

Not sure about PDFs (though I suppose you could upload them to Google Drive or whatever, and provide a documentation link that way?), but any file that Cursor itself can open can be attached to an AI conversation just like any other file in your workspace.

1

u/boscop Oct 14 '24

Hm, can I add any set of local files (outside of my workspace) to all conversations in this workspace?

2

u/Eunomiac Oct 16 '24

To all conversations? No, and you wouldn't want to --- remember that context window limit, you don't want to fill it up before you've even asked your question!

As for local files outside of your workspace, I've never tried --- I usually just create a ./dev folder in my workspace and copy any files I want to use into there. The way I add files to the chat is by right-clicking them in the explorer sidebar (which requires the files to be in your workspace).

Oh, you can leverage multifolder workspaces to do this: File -> Add Folder to Workspace -> select whichever folder has the files you want to include. It'll appear as a second section in the Explorer, beneath your main workspace folder, and then you can right-click files from there to add them to chat.