Hacker News new | ask | show | jobs
by erhaetherth 762 days ago
I was trying to fetch key-value pairs out of a database using PHP+PDO the other day and I knew there was a nice easy to do it but I couldn't remember how. Something about fetchAll, maybe PDO::FETCH_GROUP|PDO::FETCH_COLUMN.... what was it?

So I asked a couple LLMs. They wrote out loops for me to format the data how I wanted. I could have copy-and-pasted that in and it would probably have worked. But I felt there was something better yet, so back to Google I go.

It's `PDO::FETCH_KEY_PAIR`. It's built-in. But oddly kind of hard to find unless you know the right thing to search for, and "key pair" was not springing to my mind.

Point is, if you just let the LLMs do your work you won't even find these better ways of doing things. And I'm quite afraid of what the LLMs are going to do to Google, Stackoverflow and documentation in general. In a couple users it'll be ungoogleable too.

2 comments

As noted LLMs can only give you what you ask for, but for a lot of problems what you ask for isn't what you need; it's two or three steps removed. And LLMs can't tell you that you're doing something wrong; unlike curmudgeonly users on SO or in various forums/channels.

My gut feeling is that we're going to enter into a 'dark age' of coding where a lot of previously available resources are going to be ransacked and made hard to find in favor of big corporation owned LLMs. It's already having an extremely bad effect on search in general; we're potentially only a few fights away from sites like SO having users leave en masse. That's why I think having a strong network of engineers to talk with will become more important than ever, almost a return to the IRC days.

Strong disagree. I have learned so many new things since I started using LLM's. Some of them I'm actually embarrassed to admit, because I should have known about them a decade ago.

If you work in a small company and you are the most experienced developer, you don't often get feedback on how you can improve things.

The trick is, quite simply: just ask. I regularly dump some code I wrote in a language model and then ask what can be done better.

I would never do that in any online space, because first, I don't wait an answer maybe some day, I need an answer NOW. And second, I prefer to avoid being called a fool.

This is precisely the wrong way to engage with LLMs. If you are asking it 'what can be done better', it'll spit out something. That something isn't necessarily better or not because it has no concept of 'better' or 'worse'.
Ah, so that's why all my code has become more concise and efficient and I've learned countless new tricks that I did not know before and probably would have never found without LLM's.

Too bad I'm "engaging with them wrong", I could have sworn it was helping me.

Seriously though, claiming LLM's don't have any higher level understanding of right and wrong and then extrapolating that to "they cannot possibly be used to improve things" is a very stubborn refusal of the fact that the most logical answer to the question "what can be improved here" is... actual improvements.

They do not have any higher level understanding of right and wrong. You lead the model on by telling it to improve something, so it will rework the code in question and tell you that it's an improvement. Regardless or not if it is. Coding is about 70% subjective, 30% objective when it comes to figuring out improvements because the majority of improvements deal with business logic and things specific to your domain.