Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

101–110 of 426 posts

Re: How I write code using Cursor

#101

Earlier quoted context omitted.

I feel like in the early stages of becoming a programmer, learning how to do all those little baseline problems is fun. But eventually you get to a point where you've solved variations of the problem hundreds of times before, and it's just hours of time being burnt away writing it again with small adjustments. It's like getting into making physical things with only a screwdriver and a hammer. Working with your hands…

That should be when you move to more sophistcated (and also complex/complicated) languages that relieve you from as much of this boilerplate as possible. The rest is then general design and archiceture, where LLMs really don't help much with. What they are really good for is to get an idea of possible options in spaces were you have little experience or to quickly explain and summarize specific solutions and their pr…

I think it is not the boilerplate of the programming language necessarily, but it is more to do with boilerplate of common business logic. E.g. even say form validation, I have done it countless of times and I can't be bothered to write out rules for each field again, but AI can easily generate me Zod schema with reasonable validation based on the database model or schema. It probably does better validation rules than I would do quickly on my first try.

Then I use these validations both in the backend and frontend.

Re: How I write code using Cursor

#102
post #64

Earlier quoted context omitted.

Completely agree. I find it fails miserably at business logic, which is where we spend most of our time on. But does great at generic stuff, which is already trivial to find on stack overflow.

Have you had a go with the o1 range of models?

Yesterday, I got into an argument on the internet (shocking, I know), so I pulled out an old gravitation simulator that I had built for a game.

I had chatGPT give me the solar system parameters, which worked fine, but my simulation had an issue that I actually never resolved. So, working with the AI, I asked it to convert the simulation to constant-time (it was currently locked to render path -- it's over a decade old). Needless to say, it wrote code that set the simulation to be realtime ... in other words, we'd be waiting one year to see the planets go around the sun. After I pointed that out, it figured out what to do and still got things wrong or made some terrible readability decisions. I ended up using it as inspiration instead and then was able to have the simulation step at one second resolution (which was required for a stable orbit) but render at 60fps and compress a year into a second.

Re: How I write code using Cursor

#103

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…

Completely agree. I find it fails miserably at business logic, which is where we spend most of our time on. But does great at generic stuff, which is already trivial to find on stack overflow.

This might be a promoting issue, my experience is very different, I’ve written entire services using it.

Re: How I write code using Cursor

#104

Earlier quoted context omitted.

Completely agree. I find it fails miserably at business logic, which is where we spend most of our time on. But does great at generic stuff, which is already trivial to find on stack overflow.

This might be a promoting issue, my experience is very different, I’ve written entire services using it.

Might be that they work in a much more complex codebase, or a language/framework/religion that has less text written on it. Might also be that they (are required to) hold code to a higher standard than you and can't just push half-baked slop to prod.

Re: How I write code using Cursor

#105
Some uses I have, e.g. a notepad in Cursor with a predefined set of files and a prompt e.g. to implement storybook stories and documentation out of components I use. I give it the current file I'm working on, and it will generate new files and update documentation files. Similarly for E2E or unit tests, it often suggests cases I would've not thought about.

The people that are negative about these things, because they need to review it, seem to be missing the massive amount of time saved imho.

Many users point to the fact that they spend most of the time thinking, I'm glad for them, most of the time I spend is glueing APIs, boilerplates, refactoring, and on those aspects Cursor helps tremendously.

The biggest killer feature that I get from similar tools (I ditched Copilot recently in favor of it) is that they allow me to stay focused and in the flow longer.

I have a tendency to phase out when tasks get too boring, repetitive or stressed out when I can't come up with a solution. Similarly going on a search engine to find an answer would often put me in a long loop of looking for answers deeply buried in a very long article (you need to help SEO after all, don't you?) and then it would be more likely that I would get distracted by messages on my company chat or social media.

I can easily say that Cursor has made me more productive than I was one year ago.

I feel like the criticism many have comes from the wrong expectations of these tools doing the work for you, whereas they are more into easing out the boring and sometimes the hard parts.

Re: How I write code using Cursor

#106

Earlier quoted context omitted.

This might be a promoting issue, my experience is very different, I’ve written entire services using it.

Might be that they work in a much more complex codebase, or a language/framework/religion that has less text written on it. Might also be that they (are required to) hold code to a higher standard than you and can't just push half-baked slop to prod.

Without knowing much about my standards and work you’ve just assumed it’s half baked slop. You’re wrong.

Re: How I write code using Cursor

#107

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…

100%. Useful cases include

* figuring out how to X in an API - eg "write method dl_file(url, file) to download file from url using requests in a streaming manner"

* Brainstorming which libraries / tools / approaches exist to do a given task. Google can miss some. AI is a nice complement for Google.

Re: How I write code using Cursor

#108
All of the examples given in the article are contrived, textbook-style examples. Real world projects are far more messy. I want someone to talk about their flow with Cursor on a mature codebase in production with lots of interlaced components and abstractions.

I have a feeling that blindly building things with AI will actually lead to incomprehensible monstrous codebases that are impossible to maintain over the long run.

Read “Programming as Theory Building” by Peter Naur. Programming is 80% theory-in-the-mind and only about 20% actual code.

Here's an actual example of a task I have at work right now that AI is almost useless in helping me solve. "I'm working with 4 different bank APIs, and I need to simplify the current request and data model so that data stored in disparate sources are unified into one SQL table called 'transactions'". AI can't even begin to understand this request, let alone refactor the codebase to solve it. The end result should have fewer lines of code, not more, and it requires a careful understanding of multiple APIs and careful data modelling design and mapping where a single mistake could result in real financial damage.

Re: How I write code using Cursor

#109

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…

I would love to see the world where you didn't use AI and instead invested the time to make yourself a stronger programmer. A react wordle clone isn't something most developers would need 2 hours to make (sure maybe the styling / hosting AROUND the wordle clone might take longer) - I'm not saying you're a bad programmer or a bad person but what is the opportunity cost of using AI here? Are you optimising yourself into a local-minima?

Re: How I write code using Cursor

#110
I really honestly don't get the hype. VSCode with some copilot plugins seems to do effectively 100% of this fork and last time I scrolled through cursor's 1000+ open github issues, they didn't seem responsive or know how to fix things.
Post reply on HN