Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

231–240 of 426 posts

Re: How I write code using Cursor

#231
post #6

In the article, you mentioned that you've been writing code for 36 years, so don't you feel IDEs like cursor make you feel less competent? Meaning I loved the process of scratching my head over a problem and then coming to a solution but now we have AI Agents solving the problems and optimizing code which takes the fun out of it.

For me it’s like riding an e-bike. More fun because I can go faster and see and do more.

I have compared AI to an emtb. Was riding one on slick rock trail in Moab which has some areas with consequences earlier this year.

If you don't know how to handle a bike, the ebike won't help you in these situations. (You might even get yourself in a tricky spot).

But if you know how to ride, it can be really fun.

Same with code. If you know how to code it can make you much more productive. If you don't know how to code, you get into tricky spots...

Re: How I write code using Cursor

#232

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…

For me it's the same. It's usually just some hallucinated garbage. All of these LLM's don't have the full picture of my project.

When I can give them isolated tasks like convert X to Y, create a foo that does bar it's excellent, but for unit testing? Not even going to try anymore. I write 5 unit tests manually that work in the time I write 5 prompts that give me useless stuff that I need to add manually.

Why can't we have a LLM cache for a project just like I have a build cache? Analyze one particular commit on the main branch very expensively, then only calculate the differences from that point. Pretty much like git works, just for your model.

Re: How I write code using Cursor

#233
post #206

Earlier quoted context omitted.

Another fun example from yesterday: pasted a blog post in markdown into a HTML comment. Selected it and told sonnet to convert it to HTML using another blog post as a style reference. Done in 5 seconds.

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.

Re: How I write code using Cursor

#234

Earlier quoted context omitted.

Chat knows how to merge CSVs with pandas. You just need to know how to prompt it correctly. (Or at least it did at the start of this year when I gave a keynote at PyCon Philippines with that exact use case.)

seems simple and obvious but not when the columns have different keys, and there could be one or more keys to match upon. i would be curious to see how you can prompt that? and you are correct, you just need to know how to prompt it correctly by going back to first principles, just like what i did.

Tossing in the first few rows of the CSV in the prompt helps.

Re: How I write code using Cursor

#235

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.

Re: How I write code using Cursor

#236
post #232

Earlier quoted context omitted.

>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…

For me it's the same. It's usually just some hallucinated garbage. All of these LLM's don't have the full picture of my project. When I can give them isolated tasks like convert X to Y, create a foo that does bar it's excellent, but for unit testing? Not even going to try anymore. I write 5 unit tests manually that work in the time I write 5 prompts that give me useless stuff that I need to add manually. Why can't we…

With Cursor you can specify which files it reads before starting. Usually have to attached one or two to get an ideal one-shot result.

But yeah, I use it for unit testing, not integration testing.

Re: How I write code using Cursor

#237

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…

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?

Cursor. Mostly chat mode. Usually adding 1-2 extra files to the context before invoking, and selecting the relevant section for extra focus.

Re: How I write code using Cursor

#240
post #206

Earlier quoted context omitted.

Another fun example from yesterday: pasted a blog post in markdown into a HTML comment. Selected it and told sonnet to convert it to HTML using another blog post as a style reference. Done in 5 seconds.

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.

> it takes 30 seconds, including the time to install pandoc

On some speedrunning competition maybe? Just tested on my work machine, `sudo apt-get pandoc` took 11 seconds to complete, and it was this fast only because I already had all the depndencies installed.

Also I don't think you'll be able to fulfill the "using another blog post as a style reference" part of GP's requirements - unless, again, you're some grand-master Pandoc speedrunner.

Sure, AI will make mistakes with such conversion tasks. It's not worth it if you're going to review everything carefully anyway. In code, fortunately, you don't have to - the compiler is doing 90% of the grunt work for you. In writing, depends on context. Some text you can eyeball quickly. Sometimes you can get help from your tool.

Literally yesterday I back-ported a CV from English to Polish via Word's Translation feature. I could've done it by hand, but Word did 90% of it correctly, and fixing the remaining issues was a breeze.

Ultimately, what makes LLMs a good tool for random conversions like these is that it's just one tool. Sure, Pandoc can do GP's case better (if inputs are well-defined), but it can't do any of the 10 other ad-hoc conversions they may have needed that day.

Post reply on HN