Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

141–150 of 426 posts

Re: How I write code using Cursor

#141

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 agree. I replaced SO with cGPT and it’s the only good case I found. Finding an answer I build onto. But outsourcing my reflexion ? That’s a dangerous path. I tried on small projects to do that, building a project from scratch with cursor just to test it. Sometimes it’s right on spot but in many instances it misses completely some cases and edge cases. Impossible to trust blindly. And if I do so and not take proper…

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 works for you. The edge cases your users will find with time.

Re: How I write code using Cursor

#142

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…

Boilerplate comes up all the time when writing Erlang with OTP behaviors though, and sometimes you have no idea if it really is the right way or not. There are Emacs skeletons for that (through tempo), but feels like they are sometimes out of date.

Re: How I write code using Cursor

#143

Earlier quoted context omitted.

> You can do most of the things the author showed with your craftfully set-up IDE and magic tricks, but that's not the point. 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. > I don't…

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

Re: How I write code using Cursor

#144

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.

I've spent a good amount of time in my career reading high quality code and slop. The difference is not some level of intelligence that sonnet does not possess. It's a well thought out design, good naming, and rigor. Sonnet is as good if not better than the average dev at most of this and with a some good prompting and a little editing can write code as good as most high quality open source projects.

Which is usually far higher than most commerical apps the vast majority of us devs work on.

Re: How I write code using Cursor

#145
post #25

This last month I decided to try the Jetbrain equivalent of Cursor, for their IDEs ( https://www.jetbrains.com/ai/ ). It's a pluging well integrated in the code editor that you can easily summon. I work in Rust and I had to start working with several new libraries this month. One example of them is `proptest-rs`, a rust property testing library that defines a whole new grammar to define the tests. I am 100% sure that…

FYI, 2024.3 that's coming in November/December will use a new model and the new code completion suggestions rewritten from scratch.

I suspect some are inspired by Cursor?

https://blog.jetbrains.com/ai/2024/10/complete-the-un-comple...

Re: How I write code using Cursor

#146
post #139

Earlier quoted context omitted.

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…

Unit tests are boiler plate ?

I'm using an expansive definition of boiler plate to be sure. But like boiler plate most unit tests require a little bit of thought and then a good amount of typing, doing things like setting up the data to test, mocking up methods, writing out assertions to test all your edge cases.

I've found sonnet and o1 to be pretty good at this. Better than writing the actual code because while modifying a system requires a lot of context of the overall application and domain, unit testing a method usually doesn't.

Re: How I write code using Cursor

#147

Personal observation from a heavy LLM codegen user: The sweet spot seems to be bootstrapping something new from scratch and get all the boilerplate done in seconds. This is probably also where the hype comes from, feels like magic. But the issue is, that once it gets slightly more complicated, thinks break apart and run into a dead end quickly. For example yesterday I wanted to build a simple CLI tool in Go (which is…

> After lots of iterations back-and-forth (Claude mostly) the code balooned in size to figure out what could be the issue, adding all kinds of useless crap that kindof-looks-helpful-but-isn't. After an hour I gave up and went through the whole code manually (few hundred lines, single file) and spotted the issue.

That's what experience with current generation LLMs looks like. But you don't get points for getting the code in/by the LLM looking perfect, you get points for what you check-in to git and PR. So skill is in realizing the LLM is running itself in circles, before you run out of tokens and burn an hour, and do it yourself.

Why use an LLM at all if you still have to do it yourself? Because it's still faster than without, and also that's how you'll remain employable - by covering the gaps that an LLM can't handle (until they can actually do full blown autonomous app development, which is still a while away, imo).

Re: How I write code using Cursor

#148
post #140
post #26

Earlier quoted context omitted.

> LLMs seem like magic unless you remember when search worked. Yikes. I didn’t even think about this, but it’s true. I’m looking for the kinds of answers that Google used to surface from stack overflow

The best way to get useful answers was (and for me still is) to ask Goggle for "How do I blah site:stackoverflow.com". Without the site filter, Google results suck or are just a mess, and stackoverflow's own search is crap.

Google used to be better but so was stack overflow. Now a lot of the answers are out-dated. And even more importantly they got rid of any questions where the answer was even a little bit subjective. Unfortunately for users that's almost all the most useful answers.

Re: How I write code using Cursor

#149
post #122

Earlier quoted context omitted.

IA generated content is the definition of slop for most people.

> IA generated content is the definition of slop The irony.

https://en.wikipedia.org/wiki/Slop_(artificial_intelligence)

English is not my mother tonge. I have never noticed the word "slop" until people started to use it to talk about AI generated content.

So for many people around the world slop = AI content.

Where is the irony if I may ask?

Re: How I write code using Cursor

#150

Earlier quoted context omitted.

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.

I've spent a good amount of time in my career reading high quality code and slop. The difference is not some level of intelligence that sonnet does not possess. It's a well thought out design, good naming, and rigor. Sonnet is as good if not better than the average dev at most of this and with a some good prompting and a little editing can write code as good as most high quality open source projects. Which is usually…

> with a some good prompting and a little editing can write code good

I agree with a good developer "baby-sitting" the model it's capable of producing good code. Although this is more because the developer is skilled at producing good code so they can tell an AI where it should refactor and how (or they can just do it themselves). If you've spent significant time refitting AI code, it's not really AI code anymore its yours.

Blindly following an AI's lead is where the problem is and this is where bad to mediocre developers get stuck using an AI since the effort/skill required to take the AI off its path and get something good out is largely not practised. This is because they don't have to fix their own code, and what the AI spits out is largely functional - why would anyone spend time thinking about a solution that works that they don't understand how they arrived at?

Post reply on HN