Live data from Hacker News

Tips for programmers to stay ahead of generative AI

spectrum.ieee.org

301–310 of 319 posts

Re: Tips for programmers to stay ahead of generative AI

#301

Earlier quoted context omitted.

This is my experience too. Paying $20/month for GPT-4 has been absolutely worth it. It barely hallucinates at all; the results aren't always perfect (and the September 2021 knowledge cut-off can be frustrating given how quickly things get out of date in the programming world) but it's more than good enough. I don't remember how I ever got by without it.

You could save some money by using GPT-4’s API and a self hosted frontend like YakGPT.

you can also just use OpenAI’s playground.

Re: Tips for programmers to stay ahead of generative AI

#302

Earlier quoted context omitted.

It’s crazy how many people miss this. GPT models can review code too! They can also write and run tests. Once the context window is big enough to fit the whole code base into it they will be better at review than you are. Eventually we’ll have fine tuned models that are experts in any subject you can think of, the only barrier is data and a lot of recent research is showing that that can be machine generated too.

GPT 4 pre nerf was terrible at reviewing non-trivial or non textbook code. I've decided to test it for a few weeks by checking stuff I caught in review or as bugs, to see if it would spot it. It was like 0% on first try (would always talk about something irrelevant) and after leading it with follow up questions it would figure out the problem half of the time and half of the time I'd just give up leading it. These we…

It’s hard to tell why you ran into such a problem without seeing how you prompted but I can offer a few pointers. Use the OpenAI playground instead of chat, it allows you to specify the system prompt and edit the conversation before each submission. System prompt is good for providing general context, tools and options but you absolutely must provide a few example interactions in the conversation. Even just two prompt and response pairs will strongly influence the rest of the conversation. You can use that to shape the responses however you like and it focuses the model on the task at hand. If you get a bad response, delete or edit it. Bad examples beget more bad responses.

Re: Tips for programmers to stay ahead of generative AI

#303
post #188

Earlier quoted context omitted.

...and makes your code public domain (you just admitted here that you're using it)- if anyone accesses app developed by you, they can use it freely without any license. Worst thing - you're feeding potentially not your code into GPT. That'd be a fireable offense to me (and a very expensive lawsuit for at least couple places I know). Not an issue if you're lone wolf, though. It's a dystopian thought, but I wouldn't be…

> if anyone accesses app developed by you, they can use it freely without any license. This is simply incorrect on every level, starting with the fact that (in the US, anyway), you can't place your works in the public domain even if you wanted to.

That's not true in at least one case: if you work for the US federal government, all of your works are automatically in the public domain. Of course, they may also be barred from disclosure for other reasons.

https://en.m.wikipedia.org/wiki/Copyright_status_of_works_by...

Re: Tips for programmers to stay ahead of generative AI

#304

Earlier quoted context omitted.

> then I think you are not a good coder and you should learn more instead of worrying about that I am not sure if its that simple and/or so black and white. Everyone is bad when they start, and even stay okay for a while. So fear is very rational, the fear of getting replaced by someone or something better is very humble. No matter how good or bad one is, theres always someone better than them. I think for most peopl…

> I think for most people its smart to adapt to using AI in their workflows to make them better and more efficient It probably is smart to try out and test everything for a while to see if it is an actual improvement or not. What I have a serious problem with is the proposal that this now needs to be part of a workflow when it actually doesn't improve anything. Generative AI in its current form may be helpful in some…

> What I have a serious problem with is the proposal that this now needs to be part of a workflow when it actually doesn't improve anything.

Yes, forcing it in the workflow might be bad for personal growth and overall culture.

I think in any form using it alongside you workflow is helping, it saves a lot of time and also helps decreasing cognitive load as one can forget about the commonly used code snippets and boilerplate code and focus on important aspects of the code.

Re: Tips for programmers to stay ahead of generative AI

#305

Earlier quoted context omitted.

So much this. The thing hallucinates far more than the hyperventilation seems willing to acknowledge. You really need to be quite competent in the thing you're asking it to do in order to ferret out the hallucinations, which greatly diminishes the potency of GPT in the hands of someone who has no knowledge of the relevant language/runtime/problem domain/etc.

Hallucination is less a problem for programming compared to other use case, because finally program must be run.

Not if the hallucination introduces runtime errors that can't be identified a priori with any sort of static analysis or compilation/interpreting stage.

But no, you're fundamentally right. It just goes to the question of whether an LLM assistant can in any sense replace or displace human programmers, or save time for human programmers. The answer seems to be somewhat, and in certain cases, but not much else.

If I already know the technology I'm querying GPT about, I'm going to spend at least some time identifying its hallucinations or realising that it introduced some. I might have been better off just doing it myself. If I don't know the technology I'm querying GPT about, I'm going to be impacted by its hallucinations but will also have to spend time figuring out what the hallucinations are and why this unfamiliar code sample doesn't work.

Re: Tips for programmers to stay ahead of generative AI

#306

Earlier quoted context omitted.

> if anyone accesses app developed by you, they can use it freely without any license. This is simply incorrect on every level, starting with the fact that (in the US, anyway), you can't place your works in the public domain even if you wanted to.

That's not true in at least one case: if you work for the US federal government, all of your works are automatically in the public domain. Of course, they may also be barred from disclosure for other reasons. https://en.m.wikipedia.org/wiki/Copyright_status_of_works_by...

You're correct, that's the one exception. Although you could argue that it's not really an exception -- it's that when you're producing IP in the course of your employment, your employer owns the copyright. And if you work for the federal government, your employer is the American people, so in a real sense we collectively hold the copyright. Which is the same as being in the public domain.

Re: Tips for programmers to stay ahead of generative AI

#307

Earlier quoted context omitted.

> I think for most people its smart to adapt to using AI in their workflows to make them better and more efficient It probably is smart to try out and test everything for a while to see if it is an actual improvement or not. What I have a serious problem with is the proposal that this now needs to be part of a workflow when it actually doesn't improve anything. Generative AI in its current form may be helpful in some…

> What I have a serious problem with is the proposal that this now needs to be part of a workflow when it actually doesn't improve anything. Yes, forcing it in the workflow might be bad for personal growth and overall culture. I think in any form using it alongside you workflow is helping, it saves a lot of time and also helps decreasing cognitive load as one can forget about the commonly used code snippets and boile…

> I think in any form using it alongside you workflow is helping

No, it is not. It can confuse and mislead you which wastes a lot of time. I lost multiple hours on different occasions figuring out subtle mistakes that it had made. It's sometimes harder (and slower) to understand someone else's code than writing the code yourself completely from scratch.

Also, if you aren't working alone, be prepared to answer code review questions on code that you haven't written. GPT is not going to take any responsibility for what it outputs. It often begins its answers to review questions with "Apologies for the oversight" followed by a revised version of the previous output.

The people I work with are used to me providing PRs that don't contain stupid mistakes. So in order to guarantee for that, I usually have to do a full blown quality control on every GPT output that I use. It can still be a time saver, but not really a significant one usually. I am still learning how to distinguish the cases in which it is not even a good idea to involve it and when it can be somewhat trusted. Seems to be highly dependent on the amount of training data in the particular problem domain and programming language.

Re: Tips for programmers to stay ahead of generative AI

#308

Earlier quoted context omitted.

It all started this year, just a few months ago, remember? It will get only better from here, don't worry. Or do, not sure. Anyway, you can't avoid it.

> Anyway, you can't avoid it. That seems certain. It's why I'm putting serious thought into leaving the industry.

Carpeting and nursing looks safe for now. Most other jobs are not. Some are very competitive already, like painting, writing, all sorts of design. Without AI it will be hard to find a job there. Driving, piloting will be mostly automated soon.

Rather then leaving it's better to adapt. AI is just one of technologies in the list. They come and go, that's the specific of IT. Except AI will stay, it will change with the time, but will never go away. Besides, it's the coolest thing right now. And will create new jobs around itself.

Re: Tips for programmers to stay ahead of generative AI

#309

Earlier quoted context omitted.

> What I have a serious problem with is the proposal that this now needs to be part of a workflow when it actually doesn't improve anything. Yes, forcing it in the workflow might be bad for personal growth and overall culture. I think in any form using it alongside you workflow is helping, it saves a lot of time and also helps decreasing cognitive load as one can forget about the commonly used code snippets and boile…

> I think in any form using it alongside you workflow is helping No, it is not. It can confuse and mislead you which wastes a lot of time. I lost multiple hours on different occasions figuring out subtle mistakes that it had made. It's sometimes harder (and slower) to understand someone else's code than writing the code yourself completely from scratch. Also, if you aren't working alone, be prepared to answer code re…

I didn't mean that using it alongside means blindly trusting it.

I think its far quick to read the code than write those 15 lines of code generally, especially for those type of code snippets. It also is a less stressful and takes very little mental energy to do so (if you already are familiar with the language and codebase)

> I am still learning how to distinguish the cases in which it is not even a good idea to involve it and when it can be somewhat trusted.

Interesting, can comments of that code block being generated by some AI tool be more helpful in your case? Sure it generally isn't' that nuanced and mostly isn't in isolation but labeling the major parts of code like generated data structures, generated functions might be easier to deal with.

Re: Tips for programmers to stay ahead of generative AI

#310

Earlier quoted context omitted.

> i haven't seen any evidence that an LLM will be capable of doing that on a non-trivial program any time in the near future Or ever, given that the level of abstraction LLMs work at is completely wrong. They can approximate the syntax of things in their training corpus, but logic? The lights are off and nobody's home.

I've already had the GPT3.5-Turbo model walk through and step-by-step isolate and diagnose errors. They 100% can troubleshoot and correct issues in the code. Literally you give it the code and the error and it can walk you through finding the solution. When I say walk you through, I generally mean when you provide it a function but the error is caused by some input that doesn't conform to expectations. If the error w…

>If the error were just a defect in the code it can generally point that out instantly.

thats not fixing bugs, that's static analysis. Finding the solution to the specific problem that needs to be solved is a lot more difficult than identifying any problem and then solving it.

Post reply on HN