Live data from Hacker News

An example of LLM prompting for programming

martinfowler.com

111–120 of 297 posts

Re: An example of LLM prompting for programming

#111
post #55

Earlier quoted context omitted.

I've noticed that after using copilot on a code base for a while, you can effectively prompt the AI just by creating a descriptive comment. // This function ends the call by sending a disconnection message to all connected peers Bam, copilot will recommend at least the first line, with subsequent lines usually being pretty good, and more and more frequently, it will recommend the whole function. I still use GPT-4 a l…

Copilot is a game-changer and very underrated IMO. GPT4 is smart but not really used in production yet. Copilot is reportedly generating 50% of new code and I can't imagine going without it.

I would really love to see that. So far, all I've seen is cookie cutter code to reduce a bit of typing time. Everything else was more or less hot garbage that just stood in the way of typing. Maybe in a few iterations or years. So far, personally, I haven't seen anything useful. Not saying there isn't anything, just that I haven't seen any use and code offered by it stank. Is there a demo of someone using it to showcase this game-changing power?

Re: An example of LLM prompting for programming

#112

Earlier quoted context omitted.

Copilot is a game-changer and very underrated IMO. GPT4 is smart but not really used in production yet. Copilot is reportedly generating 50% of new code and I can't imagine going without it.

I would really love to see that. So far, all I've seen is cookie cutter code to reduce a bit of typing time. Everything else was more or less hot garbage that just stood in the way of typing. Maybe in a few iterations or years. So far, personally, I haven't seen anything useful. Not saying there isn't anything, just that I haven't seen any use and code offered by it stank. Is there a demo of someone using it to showc…

It surprises me to hear this. Have you used it as I described by writing a descriptive comment first then waiting to see its response?

I only noticed it getting good at this after I was somewhat far along on a project, so I assume it requires an overall knowledge of what you're trying to do first.

Re: An example of LLM prompting for programming

#113

Is there a tool that allows to do this within a text editor (for instance VS Code). Using selection instead of copy pasting. Having the LLM store its output directly within local files. Maybe giving it access to a shell to run the tests on its own ?

Copilot X will include that capability.

Re: An example of LLM prompting for programming

#114
I feel like from an information theory perspective there is a lower bound on how little we can write to get a sufficiently specific spec for the AI to generate correct code.

This example seems like almost as much work as just writing the code myself. I think English is just too fuzzy, maybe eventually we will get a language tailored to AI that will put more specific limits on the meanings of works. But then how is it all that different from Python?

Re: An example of LLM prompting for programming

#115
post #83

Earlier quoted context omitted.

As a hobbyist developer with no formal training, I wish Copilot had a 'teaching' or "Senior Dev" mode, where I can play the role of the Junior Dev. I'd like it to pick up on what I'm trying to write, and then prompt me with questions or hints, but not straight up give me the code. Or, if that's too Clippy-like annoying, let me prompt it when I'm stuck, and only then suggest hints or ask suggestive questions that guid…

The Github Copilot Labs extension has "codebrushes" that can transform and explain existing code instead of generating new code, but none of it only gives "hints". Maybe one of the codebrushes can take a custom prompt.

You can create custom brushes, or open the "CoPilot Labs" panel and "explain" with a custom prompt.

Re: An example of LLM prompting for programming

#116
post #45

To me, this is a great illustration of why chat is a terrible interface for a coding tool. I've gone down this path as well, learning that you need to have a detailed prompt that establishes a lot of context, and iteratively improve it to generate better code. And yup, generating a task list and working from that is definitely a key strategy for getting GPT to do anything bigger than a few paragraphs. But compare tha…

Either way, you’re sending your companys biggest asset to another company, aren’t you? I’ll try these tools when they start being able to run locally

I sort of disagree that code is the biggest asset. Take the Yandex leak. What can you do with it? Outcompete them?

Re: An example of LLM prompting for programming

#118
post #28

Earlier quoted context omitted.

I'd rather farm all my own food, build my own house, and teach my own kids, but I don't have infinite time each day.

The prompt was almost as much work as the code, and there was no way to write that prompt without a CS education and/or years of development experience.

I have found that this applies to many Crafts.

Cutting wood is easy. Simple really. Crafting an attractive and functional chair requires discipline. Designing it? Brilliance.

Re: An example of LLM prompting for programming

#119
post #35

What I want is a prompt that continuously copies whatever I'm doing, so I can ask to complete the task. For example, say I'm converting all identifiers in a file from lowercase to CamelCase. Then after doing like 3 of them, I can ask the LLM to take over and do the remainder.

I mean, that kind of task is more than easy to do today. You could probably just create a VS Code extension that you type "convert all identifiers in this file that match this pattern from lowercase to camel case" and pipe that to the GPT API to instantly do it (without even needing to give it the first 3 examples).

Sometimes just doing stuff takes less energy than thinking about how it can be automated.

Re: An example of LLM prompting for programming

#120

Earlier quoted context omitted.

I surely hope they use my copyrighted code and make millions out of it. Ideal case for me to sue them for lots of money.

How would you ever know? It will come in chunks of a dozen or less lines at a time and it will be written into your competitor's proprietary codebase (that you don't have access to).

> GitHub Copilot [for business] transmits snippets of your code from your IDE to GitHub to provide Suggestions to you. Code snippets data is only transmitted in real-time to return Suggestions, and is discarded once a Suggestion is returned. Copilot for Business does not retain any Code Snippets Data.

Likely, some employee would whistleblow that they're not complying with their privacy policy, and either government litigation or a class action lawsuit would ensue. That legal process would involve subpoenas and third-party auditors being granted access to GitHub/Microsoft's internal code and communications history, which makes it pretty hard to hide something as big as collecting, storing, and then training from a huge amount of uploaded code snippets they promised not to.

It's not inconceivable that they're noncompliant, but my bet would be that if they are collecting data they explicitly promise not to it's an accidental or malicious action by an individual employee, and they will freak out when they discover it and delete everything as soon as they can. If they intended to collect that data, it would be much easier to write that into the policy than deal with all the risk.

Notably, this applies to Copilot for Business, which is presumably what you're using if you are at work.

Post reply on HN