Live data from Hacker News

An example of LLM prompting for programming

martinfowler.com

141–150 of 297 posts

Re: An example of LLM prompting for programming

#141

Earlier quoted context omitted.

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 l…

Couldn't it happen more subtly, without having the code lying around for long? The model could be doing online-learning (ML term) and only then they discard code that they get send. This means your code could appear in other people's completions/suggestions, without it having to lie anywhere. It is basically learned into the model. The code could appear almost or even completely verbatim on someone else's machine, possibly working for a competitor. Even that it is your code would not be obvious, because MS could claim, that Copilot merely accidentally constructed the same code from other learned code.

Not sure that this is how the model works, but it is conceivable.

Re: An example of LLM prompting for programming

#142
post #56

Earlier quoted context omitted.

> Copilot is much better for someone actually writing code I haven't used copilot yet, but I'm using occasionally chatgpt with prompts such as "write a bash/python script take takes these parameters and perform this tasks". Then I iterate if needed, and usually, i can get what i want faster than without using chatgpt. It's not a game changer, but it's a performance boost. How natural language is a distraction here? a…

Try not using natural language and just type what you'd type into Google. You'll get the same results and realize that all of the natural language fluff is totally unnecessary. I just typed in "bash script recursive chmod 777 all files" (as a dumb toy example) and got a resulting script back. It was surrounded by two natural language GPT comments: > It's generally not recommended to give all files and directories the…

[deleted]

Re: An example of LLM prompting for programming

#143

If somebody thinks an LLM is coming for everybody's coding job, I'd say this article is a great counterpoint just for existing. You could tell someone from decades ago that we now use a very high level language for complex tasks in complex code ecosystems, never even mention AI, explain that the parser is really generalist-biased, and this article would make perfect sense as an example of exemplary code by a modern c…

The opposite might be true, and here’s why - 1) by using English as spec, the barrier of entry has gone lower, 2) LLMs can also write prompts and self introspect to debug.

English as a spec is incredibly "fuzzy", there are many valid interpretations of intent. I don't think that can be avoided?

Re: An example of LLM prompting for programming

#144

Is it me or does this just create a bunch of extra steps and gratuitous complexity? These tools are not so efficient or make anything easier, it seems. I'm sorry to the enthusiasts here - I am usually excited about AI and a student of Computational Linguistics, but I think this emperor is naked.

I have been trying to find a use case for these LLMs and I continue to keep an eye just in case someone figures out a way to use them that I find useful in my workflow. My only use for them so far is as an explorative tool for tasks I'm not familiar such as when having to work with programming languages I never use. For such things its great as not only do I not have to go digging through the documentation, I also do not have to then search the web for examples on how its actually used.

This is taking into account that I have removed the cost of using it as much as possible since I do not have to switch to a browser tab, asks my question, wait for reply and then copy any useful text to my editor. I have it setup as a function call inside my repl along with saved history to a local file in case I need it.

Even with this convenient way of using it I notice that pretty much the only time I use it when working on my actual projecs is just to save me the trouble of doing a google search for trivial things such as looking up word definitions/synonyms for naming things or for anything else where I would expect to find the answer with just a bit of googling. I can just quickly do my request and continue with whatever I was doing and then return for my answer later.

Re: An example of LLM prompting for programming

#145

Earlier quoted context omitted.

No or no company would be able to use it. As you type fragments of code are sent and discarded after use. You need to trust Microsoft to actually do the discarding but contractually they do and you can sue them if they accidentally or deliberately keep your code around or otherwise mismanage it.

But that is naive, isn't it? Who has the money and time in their life, to actually sue MS? Even if "you" is a business, few will have the resources for that.

Individuals do not (although a class action would be feasible), but large companies that use Github and other Microsoft products, of course they have both the means to sue Microsoft and the motivation should their business be impacted.

Re: An example of LLM prompting for programming

#146

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…

Copilot only writes boilerplate, it can't really handle anything non-trivial. But I write a lot of boilerplate, even using abstraction and in decent programming languages. A surprising amount of code is just boilerplate, even just keywords and punctuation; and there's a lot of small, similar code snippets that you could abstract, but it would actually produce more code and/or make your code harder to understand, so it isn't worth the effort.

Plus, tests and documentation (Copilot doubles as a good sentence/"idea" completer when writing).

Re: An example of LLM prompting for programming

#147
post #56

Earlier quoted context omitted.

> Copilot is much better for someone actually writing code I haven't used copilot yet, but I'm using occasionally chatgpt with prompts such as "write a bash/python script take takes these parameters and perform this tasks". Then I iterate if needed, and usually, i can get what i want faster than without using chatgpt. It's not a game changer, but it's a performance boost. How natural language is a distraction here? a…

Try not using natural language and just type what you'd type into Google. You'll get the same results and realize that all of the natural language fluff is totally unnecessary. I just typed in "bash script recursive chmod 777 all files" (as a dumb toy example) and got a resulting script back. It was surrounded by two natural language GPT comments: > It's generally not recommended to give all files and directories the…

I tried this with the following:

"Bash script to add a string I specify to the beginning of every file in a directory, unless the file begins with “archive”"

I tried looking for this on Google and didn't find anything that did this -- although I could cobble together a solution with a couple of queries.

The interesting thing is that I wanted ChatGPT to append the string to the filename -- that's what I meant. But it actually append the string to the actual file. That's actually what I said, so I give it credit for doing what I said, rather than what I meant. And honestly my intent isn't necessarily obvious.

I definitely see this as a value add over just searching with Google.

Re: An example of LLM prompting for programming

#148

> He's using a generic application example in here: one thing to be wary of when interacting with ChatGPT and the like is that we should never put anything that may be confidential into the prompt, as that would be a security risk. Business rules, any code from a real project - all these must not enter the interaction with ChatGPT. Remember, when storing your business code on Github servers hosted by Microsoft, it is…

The hosting is not the issue. Github would have different security requirements for code hosted in a private repo for a paying org than OpenAI would for free users sending prompts to an LLM. It can and should be assumed anything you type into ChatGPT is being logged to be potentially read by a human.

Re: An example of LLM prompting for programming

#149

I guess this is neat but I’d rather write code myself.

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.

Presumably you have time to write your own code as a developer, since you're not being paid to be a farmer or carpenter?

Re: An example of LLM prompting for programming

#150

For some reason, this reminds me of how we used to give instructions to Indian coders in the 90s and early 2000s. You would have to spell out everything. What you got back was nearly there, but some back-and-forth was involved. This brings back some terrible memories.

The big difference is that you get the results immediately and iterations take minutes not days
Post reply on HN