Live data from Hacker News

How I write code using Cursor

arguingwithalgorithms.com

401–410 of 426 posts

Re: How I write code using Cursor

#401

Earlier quoted context omitted.

The benefits of exploring is finding alternatives and knowing about gotchas. And knowing more about both the problem spaces and how the language/library/framework solves it.

I mean sure, but this is exactly the argument against using a calculator and doing all your math by hand also.

There was a thread about that and gist was: A calculator is a great tool because it's deterministic and the failures are known (mostly related to precision); It eliminates the entire need of doing computation by hand and you don't have to babysit it though the computation process with "you're an expert mathematician..."; Also it's just a tool and you still need to learn basic mathematics to use it.

The equivalent to that is a good IDE that offers good navigation (project and dependencies), great feedback (highlighting, static code analysis,..), semantic manipulation, integration with external tooling, and the build/test/deploy process.

Re: How I write code using Cursor

#402
post #50
post #39

Earlier quoted context omitted.

How do you know that it didn’t make any mistakes, which you wouldn’t make if you learned the usage of that library without AI? Even before AI generated code, people made mistakes about which they didn’t know, because they never read the documentation for example, and it “worked”… except the unintended side effects of course. Adding an AI layer into the picture makes this definitely worse.

How's the AI worse in this respect that having a coworker or teammate that you review code from?

Responsibility

Re: How I write code using Cursor

#403
post #123
post #39

Earlier quoted context omitted.

How do you know that it didn’t make any mistakes, which you wouldn’t make if you learned the usage of that library without AI? Even before AI generated code, people made mistakes about which they didn’t know, because they never read the documentation for example, and it “worked”… except the unintended side effects of course. Adding an AI layer into the picture makes this definitely worse.

It's not that you ask it to write 200 lines of code at once, and blindly trust it. It's more that you start to use the lib, ask it to generate one helper method at the time, for an isolated task. Which leave you time to "review" the code that it wrote properly. Even when a human writes code, it needs to go through peer-review. So the exact same applies with AI. It's the job of the reviewer (in this case, the one who…

You need to know the used methods to review either way (when you really review code, which is not done by most people). You need to read the doc either way. At that point you could just write the code yourself. And as many examples showed (e.g. https://news.ycombinator.com/item?id=41307387), it’s not even that quick.

Re: How I write code using Cursor

#404
post #382

Earlier quoted context omitted.

I've been keeping an eye out for a good, free software development tool like this but I've also seen nothing viable yet. The main problem really seems to be that the required hardware is expensive and resource intensive which keeps most of the talent from being able to work on it. Once the required hardware becomes more common place I think multiple free software versions will pop up to fill the niche.

Have you looked at Continue.dev? It’s open source and allows both local/open source and commercial models. It’s definitely got challenges / bugs (particularly for remote dev) but I think is worth a look.

Thanks! I'll check it out.

Re: How I write code using Cursor

#405
post #194
post #162

Earlier quoted context omitted.

Quite often, yes. That's why I prefer integration tests.

Indeed. To many tests are just testing nothing other than mocks. That goes for my coworkers directly and for their Copilot output. They’re not useful tests, they are thing to catch actual errors, they’re maybe useful as usage documentation. But in general, they’re mostly a waste. Integration tests, good ones, are harder but far more valuable.

This has been my approach in the past that only certain parts of the code are worth unit testing. But given how much easier unit tests are to write now with AI I think the % of code worth unit testing has gone up.

Re: How I write code using Cursor

#406

Why is 60 - 70% of my screen whitespace on this website (Or maybe more accurately... light pink space?) If cursor made those margins, humans 1 cursor 0

I actually like it. Better readability and the empty space can be used for showing citations, which the author seems to do a lot.

If you're going to employ large empty space, at least make it dark themed.

Re: How I write code using Cursor

#407
post #395

I find LLM’s to be much worse than the junior engineers I work with. I have tried copilot and I always end up disabling it because it’s often wrong and annoying. Just read the docs for the things you are using folks. We don’t need to burn the rainforest for autocomplete.

I am currently convinced that the only thing useful about AI so far is that it's reviving nuclear power plants -- granted, they are to power AI engines -- but I hope that they'll be kept running after this AI fad passes!

Re: How I write code using Cursor

#408
post #194

Earlier quoted context omitted.

Indeed. To many tests are just testing nothing other than mocks. That goes for my coworkers directly and for their Copilot output. They’re not useful tests, they are thing to catch actual errors, they’re maybe useful as usage documentation. But in general, they’re mostly a waste. Integration tests, good ones, are harder but far more valuable.

This has been my approach in the past that only certain parts of the code are worth unit testing. But given how much easier unit tests are to write now with AI I think the % of code worth unit testing has gone up.

> But given how much easier unit tests are to write now with AI I think the % of code worth unit testing has gone up.

I see the argument, I just disagree with it. Test code is still code and it still has to be maintained, which, sure "the AI will do that" but now theres a lot more that I have to babysit.

The tests that I'm seeing pumped out by my coworkers who are using AI for it just aren't very good tests a lot of the time, and honestly encode too much of the specific implementation details of the module in question into them, making refactoring more of a chore.

The tests I'm talking about simply aren't going to catch any bugs, they weren't used as an isolated execution environment for test driven development, so what use are they? I'm not convinced, not yet anyway.

Just because we can get "9X%" coverage with these tools, doesn't mean we should.

Re: How I write code using Cursor

#410
post #391
post #387

Earlier quoted context omitted.

I’m looking at 150000 lines of Swift divided over some local packages and the main app, excluding external dependencies

Do you have 150000 lines of Swift in YOUR context window?

I know how to find the context I need, being aided by the IDE and compiler. So yes, my context window contains all of the code in my project, even if it's not instantaneous.

It's not that hard to have an idea of what code is defined where in a project, since compilers have been doing that for over half a century. If I'm injecting protocols and mocks into a unit test, it shouldn't be really hard for a computer to figure out their definitions, unless they don't exist yet and I was not clear they should have been created, which would mean that I'm giving the AI the wrong prompt and the error is on my side.

Post reply on HN