Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

271–280 of 426 posts

Re: How I write code using Cursor

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

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

Installing pandoc is basically a one-time cost that is amortized over its uses, so... why worry about it?

Relying on the compiler to catch every mistake is a pretty limited strategy.

Re: How I write code using Cursor

#272
post #141

Earlier quoted context omitted.

The AI's are to a large degree trained on tutorial code, quick examples, howto's and so on from the net. Code that really should come with a disclamer note: "Dont use in production, only example code.". This leads to your code being littered with problematic edge-cases that you still have to learn how to fix. Or in worst case you don't even notice that there are edge cases because you just copy-pasted the code and it…

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.

Re: How I write code using Cursor

#273
Good Taste, Management / Communication Skills, Code Review Ability.

If you have these skills, the productivity gains from tools like Cursor are insane.

If you lack any of these, it makes sense that you don't get the hype; you're missing a critical piece of the new development paradigm, and should work on that.

Re: How I write code using Cursor

#274
Related question. For those who do any kind of programming for fun on the side, how do you feel about using tools like cursor for those projects. Is it a cool productivity enhancer that allows you to focus less on the code and more on the end-product, or does it suck the fun out of it for you?

I work in an environment right now where feeding proprietary code/docs into 3rd party hosted LLMs is a hard no-go, and we don't have any great locally hosted solution set up yet, so I haven't really taken the dive into actively writing code with LLM assistance. I feel like I should practice this skill, but the idea of using a tool like Cursor on personal projects just seems so antithetical to the point that I can't bring myself to actually do it.

Re: How I write code using Cursor

#275

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…

Nope

You wouldn't be the first engineer to fade into irrelevance because they were too proud to adapt to the changing world around them. I'd encourage you to open your mind a bit.

Re: How I write code using Cursor

#276

Earlier quoted context omitted.

On a good day, when you're using the most recent right version of MacOS, when all of the frontend tool's couple thousand dependencies isn't transiently incompatible with everything else, yes. (If no, AI probably won't help you here either. Frontend stuff moves too fast, and there's too much of it. But then perhaps the AI model could tell you that the frontend tool you're using is a ridiculous overkill for your proble…

I'll be honest, I've never had the command line tool to setup a React / NextJS / Solid / Astro / Svelt / any framework app fail to make something that runs, ever

What exactly magic command line tool are you referring to? What cmd tool configures the frontend framework to use a particular css framework, webpack to work with your backend endpoints properly, setups cors and authentication with the backend for development, configures the backend to point to and serve the spa?

Re: How I write code using Cursor

#277
Here's a few cursor perks:

  1. Auto-complete makes me type ~20% faster (I type 100+ WPM)
  2. Composer can work across a few files simultaneously to update something (e.g. updating a chrome extension's manifest while proposing a code change)
  3. Write something that you know _exactly_ how it should work but are too lazy to author it yourself (e.g. Write a function that takes 2 lists of string and pair-wise matches the most similar. Allow me to pass the similarity function as a parameter. Use openai embedding distance to find most similar pairings between these two results)

Re: How I write code using Cursor

#278

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…

Disagree. I still spend a good amount of time on boilerplate. Stuff that's not thinking hard about the problem I'm trying to solve. Stuff like units tests, error logging, naming classes, methods and variables. Claude is really pretty good at this, not as good as the best code I've read in my career but definitely better than average. When I review sonnets code the code is more likely to be correct than if I review my…

[deleted]

Re: How I write code using Cursor

#279

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…

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)

Re: How I write code using Cursor

#280

Earlier quoted context omitted.

> Wrong you can do most of the things the author showed with a fresh install of vim/emacs or by logging in to a fresh install of vscode/intellij - In other words no lifetime was spent on this, I like having as bare an experience as possible so I can use the same setup on any computer. Sure, though, for example, I haven't a clue for the shortcut for wrapping an expression in a try/catch block. With Cursor I just press…

> You figure this out by banging your head once or twice. Amen to that. People really underestimate the power of brain damage in this field.

Naw, I've seen enough hiring fads ;).
Post reply on HN