from Hacker News

Show HN: AI Chats Unable to Solve Easy Coding Problem

by keernan on 3/20/25, 12:52 AM with 1 comments

I needed a bash script that, given a path, would detect empty directories. More specifically, I wanted the script to only list the highest parent directory (in other words, if there were no files anywhere beneath parent and within parent's subdirs, then just output the parent).

I figured this would be quite simple, but since I was already working with a AI chat, I gave it a prompt with the rules and objective. After 30 mins of so, I switched to DeepSeek, thinking it would output a solution on the first try. Nope. Not even after more than 90 minutes of back and forth with debugging.

I was very surprised. As an aside, I solved it on my own in a simple two step process:

Step 1: Use find $dir -type d with the sorted output input into an array.

Step 2: Set parent to 'start'; Iterate the sorted array and continue the loop if the array_ele was a child of parent - otherwise echo $dir and set parent=$dir

Easy Peasy. But quite surprised both AI chats struggled to find a solution in bash (I limited the AI to bash).

  • by nullpoint420 on 3/20/25, 12:53 AM

    I don’t know why, but I’ve found AI assistants to be less effective recently. They’ve just been outputting slop for me.