Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

261–270 of 426 posts

Re: How I write code using Cursor

#261
post #250

Can someone please elaborate how Cursor is different to Copilot?

The founders did an episode on Lex Fridman's podcast that covers the technical sides of Cursor far better than I ever could: https://www.youtube.com/watch?v=oFfVt3S51T4

But to summarize, Copilot is an okay ChatGPT wrapper for single line code completion. Cursor is a full IDE with AI baked in natively, with use-case specific models for different tasks, intelligent look-ahead, multi-line completion, etc.

If Copilot is a horse, Cursor is a Model T.

Re: How I write code using Cursor

#262

From what I see, it's not better than GitHub Copilot for my use case. I work in large code bases, where the code in one files depends on the code in other files. Copilot seems to only be aware of code in current file, unless I write very long prompts to direct it to specifically look in some other files. So for making changes to existing code, Copilot isn't helpful and neither seems to Cursor. I can use Copilot to wr…

Have you actually used Cursor? It does not seem like it. I'd suggest trying it before dismissing it.

> Copilot seems to only be aware of code in current file

Cursor does not have this limitation

Re: How I write code using Cursor

#263
post #206

Earlier quoted context omitted.

And how do you trust that it didn't just alter or omit some sentences from your blog post? I just use Pandoc for that purpose and it takes 30 seconds, including the time to install pandoc. For code generation where you'll review everything, AI makes sense; but for such conversion tasks, it doesn't because you won't review the generated HTML.

You didn't also factor in the time to learn Pandoc (and to relearn it if you haven't used it lately). This is also just one of many daily use cases for these tools. The time it takes to know how to use a dozen tools like this adds up when an LLM can just do them all.

This is actually how I would use AI: if I forgot how to do a conversion task, I would ask AI to tell me the command so that I can run it without rejiggering my memory first. The pandoc command is literally one line with a few flags; it's easily reviewable. Then I run pandoc myself. Same thing with the multitude of other rarely used but extremely useful tools such as jq.

In other words, I want AI to help me with invoking other tools to do a job rather than doing the job itself. This nicely sidesteps all the trust issues I have.

Re: How I write code using Cursor

#264

I recently started using Cursor for all my typescript/react personal projects and the increase in productivity has been staggering. Not only has it helped me execute way faster, similar to the OP I also find that it prevents me from getting sidetracked by premature abstraction/optimization/refactoring. I recently went from an idea for a casual word game (aka wordle) to a fully polished product in about 2h, which woul…

You're getting a lot of snark in the comments, but your excitement is warranted. It's fascinating how any claims of a code tool being useful always seem to offend the ego and bring out all the chest-thumping super-programmers claiming they could do it better.

Re: How I write code using Cursor

#265

Earlier quoted context omitted.

What you describe would be needed for a fully autonomous system. But for a copilot sort of situation, the LLM doesn't need to understand and know of _everything_. When I implement a feature into a codebase, my mental model doesn't include everything that has ever been done to that codebase, but a somewhat narrow window, just wide enough to solve the issue at hand (unless it's some massive codebase wide refactor or co…

I use copilot daily and because it lacks context it's mostly useless except for generating boilerplate and sometimes converting small things from A to B. Oh, also copying functions from stackoverflow and naming them right. That's about it. But I spend maybe 5% of my time per day on those.

I dislike Copilot's context management, personally, and much prefer populating the context of say Claude deliberately and manually (using Zed, see https://zed.dev/blog/zed-ai). This fits my workflow much much better.

Re: How I write code using Cursor

#266

Earlier quoted context omitted.

I started like this. Then I came around and can’t imagine going back. It’s kinda like having a really smart new grad, who works instantly, and has memorized all the docs. Yes I have to code review and guide it. That’s an easy trade off to make for typing 1000 tokens/s, never losing focus, and double checking every detail in realtime. First: it really does save a ton of time for tedious tasks. My best example is test…

>My best example is test cases. I can write a method in 3 minutes, but Sonnet will write the 8 best test cases in 4 seconds For me it doesn't work. Generated tests fail to run or they fail. I work in large C# codebases and in each file I have lots of injected dependencies. I have one public method which can call lots of private methods in the same class. AI either doesn't properly mock the dependencies, either ignore…

Ask Cursor to write usage and mocking documentation for the most important injected dependencies, then include that documentation in your context. I’ve got a large tree of such documentation in my docs folder specifically for guiding AI. Cursor’s Notebook feature can bundle together contexts.

I use Cursor to work on a Rust Qt app that uses the main branch of cxx-qt so it’s definitely not in the training data, but Claude figures out how to write correct Rust code based on the included documentation no problem, including the dependency injection I do through QmlEngine.

Re: How I write code using Cursor

#267

Earlier quoted context omitted.

What is the best workflow to code with an AI? Copy and paste the code to the Claude website? Or use an extension? o something else?

I personally use copilot, which is integrated into my IDE, almost identical to this Cursor example.

Does Copilot do multi-file edits now?

Re: How I write code using Cursor

#268

Someone experienced enough could give some insights about how does it work with big monorepos and/or legacy code?

Cursor will use embeddings to figure out if it needs more files for additional context, or you can manually add them. It’s one of the weakest parts of the experience. Probably varies from repo to repo. Still not really capable of large scale automatic refactors.

Agreed. Even long-context models lose track of what they're doing pretty quickly as the size of the code base grows.

Cursor et al seem great for make small changes in context, or big changes in small apps. But I don't trust them to make large-scale refactoring decisions.

That said, if you can define really rigorous interfaces between parts, you can often get more mileage by just keeping those interfaces in context while asking for some kind of refactoring or implementation.

Re: How I write code using Cursor

#269

I've been using AI to solve isolated problems, mainly as a replacement of search engine specifically for programming. I'm still not convinced of these "write whole block of code for me" type of use case. Here's my arguments against the videos from the article. 1. Snake case to camelCase. Even without AI we can already complete these tasks easily. VSCode itself has command of "Transform to Camel Case" for selection. I…

I started like this. Then I came around and can’t imagine going back. It’s kinda like having a really smart new grad, who works instantly, and has memorized all the docs. Yes I have to code review and guide it. That’s an easy trade off to make for typing 1000 tokens/s, never losing focus, and double checking every detail in realtime. First: it really does save a ton of time for tedious tasks. My best example is test…

> Instant and pretty great code review: it can understand what you are trying to do, find issues, and fix them quickly. Just ask it to review and fix issues.

Cursor’s code review is surprisingly good. It’s caught many bugs for me that would have taken a while to debug, like off by one errors or improperly refactored code (like changing is_alive to is_dead and forgetting to negate conditionals)

Re: How I write code using Cursor

#270

It's amazing how little of my colleagues don't use Cursor simply because they haven't taken the 10 minutes to set it up. It's amazing how many naysayers there are about Cursor. There are many here and they obviously don't use Cursor. I know this because they point out pitfalls that Cursor barely runs into, and their criticism is not about Cursor, but about AI code in general. Some examples: "I tried to create a TODO…

The naysayers used to bother me, but then I realized it’s no skin off my back if they don’t want to become familiar with a transformative technology. Stay with the old tools, people are getting excited for no reason at all, everyone is just pretending to be more productive! It reminds me of how blackberry users insisted physical keyboards were necessary and smartphone touchscreen users were deluded.

I think most naysayers are threatened by the inevitable decimation of our value. Supply and demand laws are going to annihilate this profession
Post reply on HN