Hacker News new | ask | show | jobs
by Karrot_Kream 479 days ago
If you're writing one-off scripts though, I find vibe coding fantastic. I found myself in a work meeting where I was mostly there to let a junior present some joint work we did and answer any questions the junior couldn't. Since I wasn't really needed (the junior eng was awesome), I was fidgeting and wanted to analyze the results from an API I had access to. A few prompts from Claude and I was hitting the API, fetching results, using numpy to crunch what I needed, and getting matplotlib to get me nice pretty graphs. I know Python and the ecosystem well so it wasn't hard to guide Claude correctly.

I probably got the whole thing done in 5 prompts and still had enough brain space to vaguely follow along the presentation. Before this kind of thing would have taken 20-30 min of heads down coding. This would have been a strictly "after work" project which means I probably wouldn't have done it (my real side projects and family need that time more than this analysis did.) That's the kind of thing that an experienced programmer can get out of vibes coding.

2 comments

Agreed. I've had a lot of success using ChatGPT for nontrivial bash one-liners. They're small in scope and there must be a huge amount of training data for them, I use them rarely enough that I don't remember details off the top of my head, and they're intrinsically throwaway code
I was doing some file management last weekend and wanted a little script to remove any numbers at the start of a file name and any region values at the end. I also wanted to ensure any duplicate files were moved into a separate folder so i could remove them.

I could have written that code. I'm sure there is a program that can do exactly that for me that I could have downloaded. But one prompt, a few tests to make sure it wasnt going to nuke all my files, and within 5 minutes I was completely done with the file management. For this type of stuff it just saves time.

> I was doing some file management last weekend and wanted a little script to remove any numbers at the start of a file name and any region values at the end. I also wanted to ensure any duplicate files were moved into a separate folder so i could remove them.

> I could have written that code.

Not knowing precisely your desired result, the benefit of going through the effort of writing a script is experienced gained and deepening one's understanding of the tools involved.

For example, assume this file structure exists:

  .
  ├── 001name-eu-central1.ext
  ├── 001name-us-west.ext
  ├── 002name-eu-central1.ext
  ├── 003name-eu-central1.ext
  ├── keep
  └── research
The script logic to do what you describe could be similar to:

  for file in [0-9]*
  do
    dest="$(echo $file | sed -E -e 's/^[0-9]*//' -e 's/-(eu-central1|us-west)//')"

    if [[ -f "keep/$dest" ]]
    then
      mv "$file" "research/$file"
    else
      mv "$file" "keep/$dest"
    fi
  done

This results in:

  .
  ├── keep
  │   └── name.ext
  └── research
      ├── 001name-us-west.ext
      ├── 002name-eu-central1.ext
      └── 003name-eu-central1.ext

The net-net is that the journey is sometimes more valuable than the destination.
I get your sentiment, but I work 40+ hours a week as a swe. I write plenty of code. I don't see how writing a loop with some conditionals and regex would be beneficial. It is something that is not difficult to do, but would take time. The destination, and getting there quickly, was the only goal I was looking for.
> I get your sentiment, but I work 40+ hours a week as a swe. I write plenty of code. I don't see how writing a loop with some conditionals and regex would be beneficial.

No worries, I get it that this example might be a bit contrived and respect the demands engineers have on our time. The reason I went into such detail was to illuminate potential benefits of "exercising mental muscles" as it relates to knocking out similar solutions quicker each time they are needed.

There's probably a program in /usr/bin on your machine that does that.
Such as /usr/bin/bash!

More seriously rename (sometimes rename.ul) is built to do (some) of this task, and you may have some others depending how "featureful" your install is, but why bother for a one time task when it's not going to be more work to figure out what tool to use, what options it needs, and what parts will still need to be done after anyways?

Honestly this is just a great task for a script, even if you were going to hand write it. It'll be clearer, rely on fewer assumptions, and be more flexible if the task needs to change as you try to do it and notice something else.

I'm sure there is! What is the best way to find it? I'd likely google some type of query to find out if it exists and how I might use it.

Anything more than one query/line of text and one click is more than it would take to get a llm to write this.

I recently tried this _exact_ same thing (except it was less of a meeting and more like a phone call) and I got stuck because it kept making up fake API endpoints OR I had to go manually login somewhere to get the API key.
When? I've found over the last 6 months or so there has been a drastic change in quality of results. I used to have a ton of hallucinations like that. It still happens, but it is significantly less common now.

I also get better results when using a prompt window built into and ide than something detached like the openai website.

AFAICT, OpenAI o3-mini-high, a couple days ago completely hallucinated functionality within systemd homectl that would mount a home directory from another machine using sshfs. It certainly wasn't available on Ubuntu 24.04, but searching the Internet I can't find those options documented anywhere.

Though, I do agree that hallucinations have dropped dramatically.

I am not an expert in systemd homect but I have found that adding, "Show documentation for any methods or built in functions used" helps when I'm working on anything obscure or that is less likely to have a lot of publically availability code (that the LLM was likely to be trained on).

That helps a lot whenever I am working off something I know will likely exist but just needs to be pulled from a company's documentation.

That did provide some more interesting results, seemingly getting closer to something that would actually work, but not quite. Perplexity, Claude, and ChatGPT all provided very different approaches. That addition to the prompt definitely did provide some useful additional information.
Hm not my experience at all. No idea what the difference was. I gave it my API endpoint and told it the response shape. As far as the key was concerned, I told Claude to look at a given envar I defined and place that in a header. Claude did all the rest. Are you using 3.7? I don't think I used the Extended Thinking mode in the UI for it.
Which model?