Hacker News new | ask | show | jobs
by stevofolife 964 days ago
What is your workflow like?
2 comments

I recently switched roles to a "data engineer" and had to pick up on many new tools I had no experience with (k8s, helm, Victoria Metrics, grafana, and a few others). In the past I would have spent probably 1+ year using these tools in inefficient or outright incorrect ways while I struggled to get a practitioner's understanding of how everything works.

Now I've developed a prompt that I think gives very good results for pair programming and iterative debugging. I discus almost everything I learn related to these tools with gpt4 to confirm my understanding is correct, and also use it for generating yaml or templating other programs.

In some ways I am a little weary of how much I use the tool since OpenAI can theoretically take it away at any time. I am heartened by the rapid development of other open models (phind code llama seems very interesting), but will continue to use GPT4 for now as its indisputably the best model out there.

I'm having a similar experience. Talking to ChatGPT is like talking to a slightly crazy person that has read every book and every github repo.

Sure, occasionally they hypothesize a really incorrect answer, but they also bring out a lot of subtleties that even field experts sometimes don't know.

It is a huge help while learning.

Same for me. I was amazed by the ability of ChatGPT. My first experience of ChatGPT was an assistance with the cover letter for the position and it gave me few paragraph that I modified to my own. It was nice to have a feedback from it that I can ask about the tone of my letter and response, it provided valuable information for me to improve my writing.

Now I use ChatGPT for scripting help especially LaTeX. It took me 3 weeks to produce a "Hello World" PDF 5 years ago and it took ChatGPT to provide me the completed tex code within 15 minutes few weeks ago. Ever since, I been exploring a lot of LaTeX syntax and see how much I can do with it with ChatGPT help. Now, I am learning about using `hyperref` package for interactive fields in PDF. I have produced few Word document for forms with tables in the past (tables in Word is a complicated b*tch) and used external PDF editor to add the interactive field for form filling. Now I am working on converting those Word documents to LaTeX.

Also, ChatGPT is a big help with AutoHotKey script & UserScript for TamperMonkey. I told ChatGPT of my intention and what I am trying to do. It produced the script exactly what I expected to work. ChatGPT is a amazing tools to use for a lot of thing.

> Also, ChatGPT is a big help with AutoHotKey script

I've tried that extensively, with no luck.

I have some experience with AHK1 and wanted ChatGPT to basically convert scripts to AHK2.

It's pretty much a loop: first response gives a syntax error. When I reply with the error message, it apologizes, explains where the error is, and gives another solution. That solution has different errors. When pasting the error message, it apologizes again, and gives a third version with syntax errors. And then it starts with the first version again, and I can repeat the loop.

Yea that can happen. I found the best way to do it is baby steps. I asked it to do point a then it will create a simple small script. Then I follow up with how I do point a to point b, then it will start to add or revise the code a bit. Then I do point c and keep adding it. It is better to break down the process and provide it in chucks of what you want it to do, it fare better to provide you something.

If it start to get off the rail, I copy the code and close the chat. Then I create a new chat and tell it to use this code as a strict reference. And I tell it what I am trying to do, then it starts to improve the code further.

I found that it is best to give it my snippet of code and it will be able to use it as a template and modify it from there.

For your case, if you want to convert it from ahk1 to ahk2, give it a small section of the script. And it should be able to convert it from there. If that didn't work, then you could start from fresh and tell it of what you want in ahk2 script.

I recently discover Plind [0], it is a ChatGPT that specialized in programming. It managed to get me a specific code that actually work with keycombo that ChatGPT struggling to produce. Maybe Plind can help you out with that?

[0] https://www.phind.com

this is amazing, so far getting great results with this
That has been my experience too with more complicated scripts/tasks. If it's something beyond basics, GPT seems to be lost in its own dreamscape and never get out of it. Then again, sometimes it produces enough pointers/links to useful docs that I can figure out the rest of the problem. So I presently use it as a slightly kooky search engine which understands the natural language questions pretty well but shouldn't be trusted literally with the results.
Yeah, I had the exact same experience.

I am surprised how bad it is with ahk scripts and wonder why. What is indeed "original" is that it gives code with unexisting functions, which it never does for the other languages (in my experience).

Perhaps the language is not that famous compared to js or C but i doubt. There are tons of forums discussing issues... Strange.

ChatGPT relies on examples to get the idea of what to do. Likely that ChatGPT don't have enough samplings across the web to know how to convert it. Even through there are documentations and man pages, but they tend to lack examples of how to do it. Usually I see in forums and discussion board that they are snippets of code that didn't provide enough context of the whole script. ChatGPT is doing its best to provide the code based on the knowledge it has. Perhaps it didn't scrap AHK scripts enough to provide a better code? Possible it didn't have enough information of how to convert ahk1 to ahk2? If that is the case, then it would be best to start fresh.
Same. I think it's due to a lack of example code on the web for it. There's some, but nowhere near eg Python.
can you share videos of how you do prompts to get AutoHotkey scripts and TamperMonkey scrips ?
If you don't mind sharing, what prompt do you use? And that is incredible to hear, GPT has done similar magnitudes of change in my own workflow.
Here is my prompt:

You are an expert programmers assistant, specializing in cloud native deployment tools like Kubernetes, helm, and their associated command line tools. When working with the users DO NOT USE PLACEHOLDERS, instead you should give commands to run that will provide the needed context to answer their question. For example, rather than answer with `k logs <insert pod name>`, you would first instruct the user to run `k get pods`, wait for the user to respond with the pod names, then you would give the full `k logs` command with the correct pod name already included in it. DO NOT SPECULATE, instead, ask the user to execute a command that will give you the information needed to answer the question.

I know there is a lot of magical thinking around prompts so take it with a grain of salt, but it as seemed to work well for me, especially around the iterative debugging process.

Thank you for sharing your prompt! I hear people talking about how much ChatGPT has changed their life and I sometimes feel like I am accidentally using an entirely different product – it’s definitely worth $20 a month but I find myself disappointed more than half the time that I reach for it. I will try some of the ideas from your prompt for my work context.

Are there any communities you use to find and discuss prompts for various used cases?

I'd compare GPT-4 to having a mid-level SWE (3-5 years experience) as a consultant.

If you're just getting started with a new technology, it's fantastic. But if you're already familiar with your stack, you'll probably produce better code on your own.

I think that is fair.

But also, the other day I had it walk me through the construction of NFA's from regexps, and then construction of a DFA from the NFA. I "know" the subject, but it's literally decades since I've done it.

That too (refreshers on a subject you used to be familiar with) seems to be an area where GPT shines - it explained it to me well, and since I had a vague recollection I remembered enough to be able to quickly determine that it was giving me correct information, which avoided the wild goosechases you sometimes get sent on when you try to dig into an entirely new subject.

It even gave me an table for an NFA for a (trivial) grammar I provided as an example, and by then I remembered enough thanks to the refresher I could easily verify that GPT and I had the same understanding of the expected output. It then converted the NFA to a DFA for me, and got that entirely correct as well.

Neither of these things are hard if you sit there with a textbook or the papers or has it fresh in mind, but it gave me a custom-tailored refresher that saved me looking it up and digging out the details I needed myself.

I feel the same way. It's a dedicated intern sitting at my desk with me, who can read documentation instantly, that's worth $150,000. And for $240/year.
The API is pure usage based. I'm using the API in an an app I'm developing, both as one of the UI means for the user to do things as well as in the backend. I'm calling their API quite a bit everyday, and my bill last month was $2.
but the api is GPT3.5 not GPT4, right?
There is something with these prompts that is akin to what children do when they have tea parties with their pets.
I have gotten a ton of use out of ChatGPT, in pretty esoteric subjects like the above, and have never needed to prompt it with “you are an expert x.” Just asking the question is always enough for me, so I’m curious why you do so here
Oh no: a thing that interprets meaning to all-caps.
Figured I'd share my system prompt as well since it's been an immense help in transitioning into game development full-time. The biggest problem I've seen is that it doesn't always get the Unity 2022 docs right, but I'm hoping the training cutoff being moved from 2021 to 2023 addresses that.

  You have expert-level knowledge of Unity, C#, and game development methodologies, design patterns, and general
  programming paradigms. Your task is to take a deep breath and then thoughtfully answer questions about game
  development in Unity concisely and with expertise. Whenever possible, explain why you've given the answer you
  chose using terminology and jargon that would be familiar to the typical game developer. You are free to end
  your message with clarifying questions for users to answer if they want more information. Refuse to answer any
  questions that aren't about games, game development, game design, or artificial intelligence. You should format
  your responses to be displayed in Discord, which supports some basic Markdown formatting.
Thx! How did you connect Gpt to discord?
Ah, I just wrote a thin wrapper connecting it to a discordrb bot so people in our discord could use it too. I'm actually refactoring the code right now to open source soon, but the hacky DIY version is here: https://gist.github.com/drusepth/23fb43ca5a325853a6abef5bfeb...
Great thanks I just can’t take on more projects I have so many unfinished as is
I have found ChatGPT to be incredibly useful as well. I don't do any fancy prompt engineering, just use plain English. Here are a few recent examples that spit out useful results.

1) can you write a python script to grab the top 3 items under each epic in azure devops?

2) postgres where clause where any item in a string array = 'GoogleApi.Entities.Places.Common.Photo'

3) here is a SQL row output of a single column. can you please extract the 30 as a new column?

P2, Site Inspection: Due 3 days ago (30-day freq.)

4)I have a build pipeline for Azure/docker that creates an AWS ecr repo if it doesn't exist. how can this specify that the images should be scanned upon creation?

      - task: CmdLine@2
        displayName: Create repo if it does not exist
        inputs:
          script: |            
            aws ecr describe-repositories --repository-names {env}-{project_name} || aws ecr create-repository --repository-name {env}-{project_name}
5) postgis query to get places sorted by distance from a lat/lon (say -104.01, 38.88). column is named location and has data like: POINT (-106.676354 39.526714)
can you share videos of how you do prompts to get better at k8s, helm, etc ? I'm sure a lot of us would like to learn how to learn better!
A few tricks that work for me when learning a new topic with chatGPT. I start by asking an overview of the subject, like a course syllabus, before diving in.

When learning a new programming language, I found it useful to tell what programming language I'm already familiar with, and ask it to relate and compare to what I already know.

When I need advice on how to achieve a certain result, I usually ask it to suggest several options and to list them with their pros and cons.

Another trick that I stole from Jeremy Howard, is to use the custom instructions to easily signal the type of answer you want. For example, I've instructed chatGPT to give a concise answer with no explanation when I prefix my question with '-sh'.

I am also curious...