Live data from Hacker News

Using AI for Coding: My Journey with Cline and LLMs

pgaleone.eu

51–60 of 97 posts

Re: Using AI for Coding: My Journey with Cline and LLMs

#51
post #23
post #5

Yeah this seems to be similar to my experiences. I use Zed’s AI assistant with Sonnet, and will generally give it 10-20k tokens of sample code from elsewhere in the codebase, shared libraries, database schema, etc. and more or less have a very specific expectation of exactly the code I want to get. More often than not, it will succeed I’ll get it faster than typing myself. However, it’s also pretty good at poking hol…

> More often than not, it will succeed I’ll get it faster than typing myself. Like, all told? The whole bit where you need to find code, paste it in, find more code, paste it in, prompt a good question and most likely iterate on it, for an answer you say you had already expected, is faster than typing it out? I don’t understand.

It is way faster, especially when you're learning a new framework and don't know all the patterns by heart even if you have a good idea how they work. If you have 2000+ hours using a specific framework then it's probably not much use except for boilerplate code but for me when I have less than 300-400 hours with each individual component of my stack... it's a gamechanger. I can probably output code at 80-90% the speed of a developer that has 10x more experience than me.

Re: Using AI for Coding: My Journey with Cline and LLMs

#52

I like looking at stack overflow for coding examples and seeing a couple of nerds getting angry at each other about the best way to do stuff. or some interesting other ways of doing stuff. this is also why i come to HN! so its weird when people want to drop that small joy from their workday

hard disagree. the amount of snobbiness and rude closing of threads as power trips was unbearable. I'm glad LLMs learned off them and we are where we are now

Re: Using AI for Coding: My Journey with Cline and LLMs

#53
post #43
post #34

Earlier quoted context omitted.

"if you need to go out of your way to find an example of correct usage of the api to paste into the prompt, why are you even bothering?" Because it's faster. Here's an example: https://tools.simonwillison.net/ocr That's an entirely client-side web page you can use to open a PDF which then converts every page to an image (using PDF.js), then runs each image through the Tesseract.js OCR program and lets you copy out th…

That's a nice little self contained example. I have yet to see this approach work for the day job: a larger codebase with complex inter-dependencies, where the solution isn't so easily worded (make the text box pink) and where the resulting code is reviewed and tested by one's peers. We actually had to make a rule at work that if you use an LLM to create an PR and can't explain the changes without using more LLMs, yo…

That's one of my personal rules for LLM usage too: "Don't commit code you couldn't explain to someone else" - https://simonwillison.net/2024/Jul/14/pycon/#pycon-2024.062....

Re: Using AI for Coding: My Journey with Cline and LLMs

#54

Prompt quality and knowing your domain is critical. One issue I had early on was experimenting with LLMs to generate a frontend application in a brand new framework I was unfamiliar with (Svelte at the time) which lead to situations where I would cruise along and get stuck in a loop. The other issue came from the increasing context size that led to more unpredictable behaviors (i would ask it to change the color of a…

Same experience with context size and prompt quality. Some other things I picked up: - If you formulate a good prompt with small (but sufficient) context and it still makes mistakes after one attempt to feed the error message back to it, it's probably not going to be able to ever get it, no matter how many iterations you do with it. It will get stuck in a rut forever. Better not to argue with it. - o1-2024-12-17 is g…

When I catch an agent falling into a “debug loop” I ask it to summarize its understanding of the error. Next, I ask it to shift its context to a higher level in the code and look for patterns across my files which would impact {summary of error).

It isn’t foolproof but it has a much better success rate for me than letting it spin.

Re: Using AI for Coding: My Journey with Cline and LLMs

#55

This is a pretty basic write up. Is there anything out there that does a survey of all of the things people have found to be successful in an engineering system for a project? (eg. Github Copilot for PR reviews, etc.)

The only thing that I have been using AI for was to translate a localization file. And it was pretty good at that.

Re: Using AI for Coding: My Journey with Cline and LLMs

#56
post #23
post #5

Yeah this seems to be similar to my experiences. I use Zed’s AI assistant with Sonnet, and will generally give it 10-20k tokens of sample code from elsewhere in the codebase, shared libraries, database schema, etc. and more or less have a very specific expectation of exactly the code I want to get. More often than not, it will succeed I’ll get it faster than typing myself. However, it’s also pretty good at poking hol…

> More often than not, it will succeed I’ll get it faster than typing myself. Like, all told? The whole bit where you need to find code, paste it in, find more code, paste it in, prompt a good question and most likely iterate on it, for an answer you say you had already expected, is faster than typing it out? I don’t understand.

You never need to paste anything. You just press "Apply".

Edit: saw you said "paste it in". Same thing there. You either just include the whole file or select the code and press "Include". You can also let the editor handle the inclusion itself based on your prompt. It will then try to find the relevant files to include.

Re: Using AI for Coding: My Journey with Cline and LLMs

#57

Looks outdated by now. Try R1. Seriously, I've been using LLMs for coding for a while and can say early experience was disappointing, but they get better and better fast. The latest o1 looks a lot better than 4o. It's reasonable to expect with proper human supervision and interface they will be able to handle big files and projects in a year or two. Interesting times...

They also said that a year or two ago

Impossible of yesterday became mundane today and obsolete tomorrow. Pace of progress is borderline debilitating, when you aren’t deafened by the woosh of goalposts flying past you.

I can confidently say the way I code today is completely different from the way I was coding in late 2022 and it changed a couple times in between then and now, too.

Re: Using AI for Coding: My Journey with Cline and LLMs

#58

Earlier quoted context omitted.

It is lovely when doing exploratory research, less so when in a hurry and you don't want to take the extra mental effort to figure out which of the nerds is right or if one of them is talking out of left field

As opposed to wondering if the llm is hallucinating? You have to expend a mental effort to think about your solutions anyway; I guess it’s pick your poison really.

Thats the issue, people just copy and paste code from llms thinking "yeah, looks fine to me". It might be a skill issue, but personally it takes me a while to understand the code its giving me and even more on how to actually implement it with all the edge cases that might happen.

Re: Using AI for Coding: My Journey with Cline and LLMs

#59
post #2

I did a similar thing but with backend-heavy code, and I agree with this assessment: > In particular, I asked ChatGPT to write a function by knowing precisely how I would have implemented it. This is crucial since without knowing the expected result and what every line does, I might end up with a wrong implementation. In my eyes, it makes the whole idea of AI coding moot. If I need to explain every step in detail - a…

Because as op pointed out it's faster. It has ready access to the correct usage of different libraries.

[dead]

Re: Using AI for Coding: My Journey with Cline and LLMs

#60
post #57

Earlier quoted context omitted.

They also said that a year or two ago

Impossible of yesterday became mundane today and obsolete tomorrow. Pace of progress is borderline debilitating, when you aren’t deafened by the woosh of goalposts flying past you. I can confidently say the way I code today is completely different from the way I was coding in late 2022 and it changed a couple times in between then and now, too.

"Isn't Lean just the same Six Sigma stuff you were selling us a year ago?"

"No no no no no. This has a totally different name"

Post reply on HN