Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

81–90 of 426 posts

Re: How I write code using Cursor

#81
post #66

Watching the videos in the article, the constantly changing suggested completions seem really distracting. Personally, I find this kind of workflow totally counter-productive. My own programming workflow is ~90% mental work / doing sketches with pen & paper, and ~10% writing the code. When I do sit down to write the code, I know already what I want to write, don't need suggestions.

It's a tool. You get used to new tools. These days I can easily process "did something interesting appear" in the peripheral vision at the same time as continuing to type. But the most useful things don't happen while I write. Instead it's the small edits that immediately come up with "would you also like to change these other 3 things to make your change work?" Those happen in the natural breaks anyway, as I start s…

> in the peripheral vision

this seems physiologically unlikely.

Re: How I write code using Cursor

#82
post #35
post #16

My problem with all AI code assistants is usually the context. I am not sure how cursor fare in this regard but I always struggle to feed the model enough of the code project to be useful for me on a level more than providing line per line suggestion (which copilot does anyway). I don't have experience with cursor or cody (other alternative) and how they tackle this problem by using embeddings (which I suppose have s…

All the SOTA LLM solutions like this have nearly the same problem. Sure the context window is huge, but there is no guarantee the model understands what 100K tokens of code is trying to accomplish within the context of the full codebase, or even into the real world, within the context of the business. They are just not good enough yet to use in real projects. Try it, start a greenfield project with "just cursor" like…

Cursor has a built in embeddings/RAG solutions to mitigate this problem.

Re: How I write code using Cursor

#83

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…

Have you tried recently to start a new web app from scratch? Specially the integration of frontend framework with styling and the frontend backend integration. Oh my god get ready to waste a full weekend just to setup everything and get a formatted hello world.

That’s why I use Rails for work. But I also had to write a small Nodejs project (vite/react + express) recently for a private project, and it has a lot of nice things going for it that make modern frontend dev really easy - but boy is it time consuming to set up the basics.

Re: How I write code using Cursor

#84

Earlier quoted context omitted.

Have you tried recently to start a new web app from scratch? Specially the integration of frontend framework with styling and the frontend backend integration. Oh my god get ready to waste a full weekend just to setup everything and get a formatted hello world.

Most frontend frameworks come with usable templates. Setting up a new Vite React project and getting to a formatted hello world can be done in half an hour tops.

It takes me all of 5 minutes with Phoenix

Re: How I write code using Cursor

#85

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 could select one ":, use "Select All Occurrences"

Only if it's the same occurrences. Cursor can often get the idea of what you want to do with the whole block of different names. Unless you're a vim macro master, it's not easily doable.

> How many of you spend 90% of time writing boilerplate instead of the core logic of the project?

It doesn't take much time, but it's a distraction. I'd rather tab through some things quickly than context switch to the docs, finding the example, adapting it for the local script, then getting back to what I was initially trying to do. Working memory in my brain is expensive.

Re: How I write code using Cursor

#86
post #66

Watching the videos in the article, the constantly changing suggested completions seem really distracting. Personally, I find this kind of workflow totally counter-productive. My own programming workflow is ~90% mental work / doing sketches with pen & paper, and ~10% writing the code. When I do sit down to write the code, I know already what I want to write, don't need suggestions.

It's a tool. You get used to new tools. These days I can easily process "did something interesting appear" in the peripheral vision at the same time as continuing to type. But the most useful things don't happen while I write. Instead it's the small edits that immediately come up with "would you also like to change these other 3 things to make your change work?" Those happen in the natural breaks anyway, as I start s…

A tool that forces me to shift from creating solutions to trying to figure out what might be wrong with some code is entirely detrimental to my workflow.

Re: How I write code using Cursor

#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?

Re: How I write code using Cursor

#89
post #40

Ok, so… I’m looking at the Python example with HTTP Endpoints and I already have questions. Why both functions are inlined and why FastAPI is used at all. I’m also not seeing any network bindings. Is it bound to local host (doubt it) or does it immediately bind to all interfaces. It’s a 3 second thought from looking at Python code that I know only enough to write small and buggy utilities (yet Python is widely popula…

Could you clarify what your problem with FastAPI here is? Also did I understand correctly that you’re not very well versed with python in general but still decided to criticize the decisions the model and the author made in that language?

I have doubts about the design and on spot decision of using FastAPI.

It’s kind of chicken and the egg problem. If author knows FastAPI then it’s great, but if not then should verify its applicability. It might not be the choice they’d make and need to verify both library and other solution if it’s not the fit.

If I’d get suggestion like that I’d immediately go to documentation because I don’t know consequences. Experienced person might make a conscious choice, unexperienced - implicit one which might not work in context.

As for the design - I’m against inlining handlers. It’s not like Python is the only language that allows it, but I would suspect consequences are very similar. But maybe that’s idiomatic thing. Had this be coming from documentation I’d had much more faith than a random LLM suggestion.

Re: How I write code using Cursor

#90
I have the opposite experience with Chat and Compose. I use the latter much more. The "intelligence level" of the Chat is pretty poor and like the author says, starts with pointless code blocks, and you often end up with AI slop after a few minutes of back and forth.

Meanwhile, the Compose mode gives code changes a good shot either in one file or multiple, and you can easily direct it towards specific files. I do wish it could be a bit smarter about which files it looks at since unless you tell it about that file you have types in, it'll happily reimplement types it doesn't know of. And another big issue with Compose mode is that the product is just not really complete (as can be seen by how different the 3 UXes of applying edits are). It has reverted previous edits for me, even if they were saved on disk and the UI was in a fresh state (and even their "checkout" functionality lost the content).

The Cmd+K "edit these lines" mode has the most reliable behavior since it's such a self-contained problem where the implementation uses the least amount of tricks to make the LLM faster. But obviously it's also the least powerful.

I think it's great that companies are trying to figure this out but it's also clear that this problem isn't solved. There is so much to do around how the model gets context about your code, how it learns about your codebase over time (.cursorrules is just a crutch), and a LOT to do about how edits to code are applied when 95% of the output of the model is the old code and you just want those new lines of code applied. (On that last one, there are many ways to reduce output from the LLM but they're all problematic – Anthropic's Fast Edit feature is great here because it can rewrite the file super fast, but if I understand correctly it's way too expensive).

Post reply on HN