Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

281–290 of 426 posts

Re: How I write code using Cursor

#281

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…

[deleted]

Re: How I write code using Cursor

#282

Earlier quoted context omitted.

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

Sounds interesting, what are you working on? (Fellow Qt developer)

Same thing: https://news.ycombinator.com/item?id=40740017 :)

Just saw you published your block editor blog post. Look forward to reading it!

Re: How I write code using Cursor

#283
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.

> And how do you trust that it didn't just alter or omit some sentences from your blog post?

How do you trust a human in the same situation? You don't, you verify.

Re: How I write code using Cursor

#284
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.

This is actually a great analogy. You get to accomplish a lot more, much faster, but you lose much of the benefit to your fitness.

Re: How I write code using Cursor

#285

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…

Maybe a TLDR from all the issues I'm reading in this thread: - It's gotten way better in the last 6 months. Both models (Sonnet 3.5 and new October Sonnet 3.5), and tooling (Cursor). If you last tried Co-pilot, you should probably give it another look. It's also going to keep getting better. [1] - It can make errors, and expect to do some code review and guiding. However the error rates are going way way down [1]. I'…

Yes, it works for new code and simple cases. If you have large code bases, it doesn't have the context and you have to baby it, telling which files and functions it should look into before attempting to write something. That takes a lot of time.

Yes, it can do simple tasks, like you said, writing a call to get the environment variables.

But imagine you work on a basket calculation service, where you have base item prices, where you have to apply some discounts based on some complicated rules, you have to add various kinds of taxes for various countries in the world and you have to use a different number of decimals for each country. Each of your classes calls 5 to 6 other classes, all with a lot of business logic behind. Besides that, you also make lots of API calls to other services.

What will the AI do for you? Nothing, it will just help you write one liners to parse or split strings. For everything else it lacks context.

Re: How I write code using Cursor

#286

Earlier quoted context omitted.

Isn't tutorial-level code exactly the best practices that everyone recommends these days? You know, don't write clever code, make things obvious to juniors, don't be a primadonna but instead make sure you can be replaced by any recently hired fresh undergrad, etc.? :)

Not really. For example, tutorial code will often leave out edge cases so as to avoid confusing the reader: if you're teaching a new programmer how to open a file, you might avoid mentioning how to handle escaping special characters in the filename.

Don't forget about Little Bobby Tables! These types of tutorials probably killed the most databases over time.

Re: How I write code using Cursor

#287

In my experience, Cursor writes average code. This makes sense, if you think about it. The AI was trained on all the code that is publicly available. This code is average by definition. I'm below average in a lot of programming languages and tools. Cursor is extremely useful there because I don't have to spend tens of minutes looking up APIs or language syntax. On the other hand, in areas I know more about, I feel th…

Exactly right. Cursor makes it easy to get to "adequate." Which in the hundreds of places that I'm not expert or don't have a strong opinion, is regularly as good as and frequently better than my first pass. Especially as it never gets tired whereas I do.

It's a great intern, letting me focus on the few but important places that I add specific value. If this is all it ever does, that's still enormously valuable.

Re: How I write code using Cursor

#288
post #88

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 happy to have gone from thinking of cloning something to cloning something using a cloning tool quickly?

Why shouldn't they be? They achieved their goal. There is little shame in cloning something.

Re: How I write code using Cursor

#289
post #250

Can someone please elaborate how Cursor is different to Copilot?

For me, the main draw is Cursor's repo-wide indexing (presumably a RAG pass). I asked Copilot to unify two functions, one at the top of a massive file, and the other at the bottom. Since they were so far apart, Copilot couldn't see both functions at the same time. Cursor didn't give me a great answer, but it did give *an* answer.

Re: How I write code using Cursor

#290
Interesting to hear the perspective of an experienced developer using what seems to be the SOTA coding assistant of Cursor/Claude.

I thought his "Changes to my workflow" section was the most interesting, coupled with the fact that coding productivity (churning out lines of code) was not something he found to be a benefit. However, IMO, the workflow changes he found beneficial seem to be a bit questionable in terms of desireability...

1) Having LLM write support libraries/functions from scratch rather than rely on external libraries seems a bit of a double-edged sword. It's good to minimize dependencies and not be affected by changes to external libraries, but OTOH there's probably a lot of thought and debugging that has been put into those external libraries, as well as support for features you may not need today but may tomorrow. Is it really preferable to have the LLM reinvent the wheel using untested code it's written channeling internet sources?

2) Avoiding functions (couched as excessive abstractions) in favor of having the LLM generate repeated copies of the same code seems like a poor idea, and will affect code readability, debugging and maintenance whereby a bugfix in one section is not guaranteed to be replicated in other copies of the same code.

3) Less hesitancy to use unfamiliar frameworks and libraries is a plus in terms of rapid prototyping, as well as coming up to speed with a new framework, but at the same time is a liability since the quality of LLM generated code is only as good as the person reviewing it for correctness and vulnerabilities. If you are having the LLM generate code using a framework you are not familiar with, then you are at it's mercy as to quality, same as if you cut and pasted some code from the internet without understanding it.

I'm not sure we've yet arrived at the best use of "AI" for developer productivity - while it can be used for everything and anything, just as ChatGPT can be asked anything, some uses are going to leverage the best of the underlying technology, while others are going to fall prey to it's weaknesses and fundamental limitations.

Post reply on HN