Hacker News new | ask | show | jobs
by cmdtab 505 days ago
Today, I needed to write a proxy[0] that wraps an object and log all method calls recursively.

I asked claude to write the initial version. It came up with a complicated class based solution. I spent more than 30 minutes getting a good abstract to come out. I was copy pasting typescript errors and applying fixes it suggested without thinking much.

In the end, I gave up and wrote what I wanted myself in 5 minutes.

0] https://github.com/cloudycotton/browser-operator/blob/main/s...

1 comments

Would you have written it in five minutes has you not just spent 30 minutes ruling out wrong solutions?
Yes. I wrote how to do it technically. Claude was able to come up with a solution that worked on second attempt. The problem was it didn’t work with typescript nicely. The approach overcomplicated anything that depended on this class.