Live data from Hacker News

Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

jstoppa.com

61–70 of 83 posts

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#61

I generally prefer using vim (and have started using neovim recently). Does anyone know when/if Cursor will provide official support to plug-ins that allow me to us its functionality in neovim? I've tried VS Code a number of times, but even with vim-bindings, it doesn't feel as nice as pure vim. I'm aware of open source alternatives like Avante.nvim [1]. I mean official support from the folks at Anysphere/Cursor, Cod…

Curious whether you've tried the VSCode Neovim extension. It is “real vim” in that it connects to a Neovim server, which means you can use your neovimrc and packages and all that. It still lives inside VSCode, so there's going to be keyboard latency and the like, but I find it really good.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#62

Earlier quoted context omitted.

I must be living in a different universe, every single LLM I've tried are shit at the details/nuances of writing code.

I tried getting Claude to help me model an event-based store with moderate type safety and it was a total disaster. It was randomly trying to convince me to turn it into a state machine using a library in Python (I was working in TypeScript). This is so far from awesome as far as productivity goes. I do find cursor suggestions useful here and there, but it’s typically filling in the simpler details of an implementati…

>>I tried getting Claude to help me model an event-based store with moderate type safety and it was a total disaster.

That's just not how you work with a LLM. You don't give LLMs problems to solve. You do the thinking part and solve problems, and ask the LLM to implement small blocks of code, like the smallest possible, and you incrementally go from there.

This really is some what like asking the whole question in the Google search bar, not seeing any result and saying Google search doesn't work.

>>it’s typically filling in the simpler details of an implementation I had to design without its help.

Most complex solutions are just reusing and connecting simpler solutions.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#63
post #55
post #22

Earlier quoted context omitted.

I don’t share the sentiment that it’s “very good”. It’s strongly mediocre at basic tasks and regularly fails at anything complex.

Have we been using the same models? Claude 3.5 Sonnet writes me excellent code in a variety of different languages. I have a bunch of examples here: https://simonwillison.net/tags/claude-3-5-sonnet/

Yes we have, but probably for different problems.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#64

Earlier quoted context omitted.

Which language are you using, and what kind of code are you writing? So far I've had good results for Javascript/Typescript and SQL for web apps and Unreal C++ for game development. I can imagine it would do way worse though if you were writing something with a lot of domain-specific knowledge, really cutting-edge stuff or in a more obscure language like Fortran - but then again, I think that most developers would al…

> You have to explain to the LLM exactly what it is that you want it to do to get the right result, then it gives you a solution. Mostly the solution is right, but when it's wrong you'll better understand the problem through the act of writing it out. The solution is either correct or incorrect. In general its level of incorrectness is not trivial. My language of choice is C#. Anytime I ask it to generate a series of…

>>The solution is either correct or incorrect.

Not even humans write 100% correct solutions. Everyday programming is not a theorem proving exercise. Programs are correct enough, to cover a agreeable amount of test cases.

>>Anytime I ask it to generate a series of classes

Generating a class is too big and broad of question to ask an LLM to generate. My chunks of inputs and outputs to/from an LLM are often on the lines of a single for loop, if block or a small chunk of code that can't be written in more than one way. There are several steps from here to a complete class.

LLM is your classic socratic thinking tool. You really to have to learn to ask and work in chunks of questions that are smallest, and involve only one change from the previous question, and are atomic enough to do a easy roll back. And you need to build from here.

As experience with the series of books The Little Schemer shows, this unfortunately is not everyone's cup of tea. A lot of people struggle to keep a train of thought in their minds and work in that workflow.

To that extent I see LLM are not for everyone. Just like how Google search was great and helped a lot of people, but the majority just couldn't bring themselves to sit in front of a screen and work for hours stitching solutions from various places on internet into a working solution.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#65
post #46
post #44

Earlier quoted context omitted.

> There's absolutely no way finding other examples on github would have been faster or higher quality. How do we ascertain its quality? The problem is this absolute trust in your reply. How do you know what it tried to "explain" was the right explanation? At least when you search and find examples you do evaluate potentially multiple solutions.

I absolutly dont trust it blindly at all. Where did you get that from? I kept asking it questions and stepping through the debugger until I understood its implementation. How do I know it's implementation is correct? Because I can see the results, I can see the data sturctures in memory, I can step though it and understand it - I know what electron densities around atoms look like, and I kept iterating on the code af…

> I absolutely don't trust it blindly at all. Where did you get that from?

Not consulting a 2nd source or just looking at the results, as in..

> Because I can see the results

Which, yes, it's correct in that sense but as per the other comments you can copy and example and get that same result. In development a lot of things are correct but have different implications, e.g. bubble sort vs quick sort.

> I'm saying is the enormous productivity increase

Assuming it has led you on the right / correct path. It's often times led me on to the wrong path instead.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#66
post #60

Earlier quoted context omitted.

I also don’t understand the appeal. I never wrote boilerplate code in my life. I recently spent the whole day debugging open source third parties on multiple OSes while using Wireshark to understand how the whole thing worked. Then I typed 5 lines for a fix in less than 30 seconds. How would an LLM help me here?

> I never wrote boilerplate code in my life. You either have not written very much code, don’t know what boilerplate means, or are intentionally operating under an overly broad definition

You’re right. I don’t write a lot of code. It’s always very specific C++ stuff that does not need to be repeated a hundred times, or if it is it can be a virtual method declaration that I copy in a subclass. No need for a LLM for that.

I’ve only seen boilerplate used by web developers, but I’m not doing that.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#67
post #62

Earlier quoted context omitted.

I tried getting Claude to help me model an event-based store with moderate type safety and it was a total disaster. It was randomly trying to convince me to turn it into a state machine using a library in Python (I was working in TypeScript). This is so far from awesome as far as productivity goes. I do find cursor suggestions useful here and there, but it’s typically filling in the simpler details of an implementati…

>>I tried getting Claude to help me model an event-based store with moderate type safety and it was a total disaster. That's just not how you work with a LLM. You don't give LLMs problems to solve. You do the thinking part and solve problems, and ask the LLM to implement small blocks of code, like the smallest possible, and you incrementally go from there. This really is some what like asking the whole question in th…

> ...and ask the LLM to implement small blocks of code, like the smallest possible, and you incrementally go from there.

So it's autocomplete++? Talk about an insane level of hype for an incremental improvement to what we already have...if that's actually what we can hope to expect from these LLMs.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#68
post #62

Earlier quoted context omitted.

>>I tried getting Claude to help me model an event-based store with moderate type safety and it was a total disaster. That's just not how you work with a LLM. You don't give LLMs problems to solve. You do the thinking part and solve problems, and ask the LLM to implement small blocks of code, like the smallest possible, and you incrementally go from there. This really is some what like asking the whole question in th…

> ...and ask the LLM to implement small blocks of code, like the smallest possible, and you incrementally go from there. So it's autocomplete++? Talk about an insane level of hype for an incremental improvement to what we already have...if that's actually what we can hope to expect from these LLMs.

At their heart LLMs are basically a mechanism to guess(predict based on probability) the next word based on what it has already done/seen so far. How it goes about guessing them, or how it gets the context is based on attention and multihead attention functions. You could say that these functions provide which part(word) of a question/sentence must get a higher weight. That basically provides context based on which it predicts what needs to come next. How it predicts is basically your plain old neural network. Just like how in linear regression you know, if your model is predicting a straight line, you know in which area the next points are likely to appear. Similar mechanisms are used here to guess what the next words are likely to be.

It is a extreme auto complete feature in the context of code for sure. Note, LLMs are not sentient. That means they can't be held responsible for making decisions. Even more so code decisions.

Now you can argue its nothing special. But its some what like arguing eclipse/intellij are not special when compared to vim/emacs. That is just splitting hairs. IDE's definitely do a lot of productive work compared to plain text editors.

The initial demo's on LLMs confuse new users a lot. The demos go on the lines of giving a sentence like 'Implement a todo list app' or something like that and LLM writes some code implementing it. That's a wrong way to work with LLMs. Don't outsource your thinking or give it whole blanket problem statement to solve it. Think about LLMs like tools that do a lot of quick text writing for you you given the smallest, non ambiguous, atomically implementable/rollback statement possible.

It gets a while to get used to this, but once you are, you are more productive.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#69
post #22
post #5

Something that's been amusing me about Cursor is that I feel a lot of the excitement about it isn't so much about Cursor, it's people realizing that LLMs have got REALLY good at writing code now. GPT-4 was good for the past year, but the latest models (especially Claude 3.5 Sonnet) are spectacular. Those of us who've been copying and pasting LLM-generated code back and forth from ChatGPT and Claude.ai for the past ye…

I don’t share the sentiment that it’s “very good”. It’s strongly mediocre at basic tasks and regularly fails at anything complex.

That's a failure of imagination. If I can architect and describe my interfaces and have Claude write the current component, then I can repeat with every other component and write minimal code / corrections.

At the same time, I've minimized complexity in my codebase. It's a win-win, and honestly probably the next paradigm of software engineering.

Re: Code Smarter, Not Harder: Developing with Cursor and Claude Sonnet

#70
post #55
post #22

Earlier quoted context omitted.

I don’t share the sentiment that it’s “very good”. It’s strongly mediocre at basic tasks and regularly fails at anything complex.

Have we been using the same models? Claude 3.5 Sonnet writes me excellent code in a variety of different languages. I have a bunch of examples here: https://simonwillison.net/tags/claude-3-5-sonnet/

For Python it's bliss. For non-std C++ it's hit-and-miss. For CUDA C++ it's terrible.
Post reply on HN