logoalt Hacker News

nasretdinovtoday at 1:10 PM0 repliesview on HN

That reminds me of why I don't think that if err != nil in Go is actually a problem, because while it's annoying to have to pause each time an error can happen, it's actually very useful, because it forces you to consider all the possible failure states and it often lets you discover the flaws in your original design while you're typing in the code. This eventually leads to much better outcomes and allows for the tools I write to be much more resilient than they otherwise would.

Obviously it all goes out of the window as soon as AI coding comes into question, and that's why I learned that I actually _don't_ want AI to generate code for me. I would only ask it simple questions like "how do I do X in Go" or in some other system, but the implementation I do myself, otherwise I lose this "having to consider every error path" part, which is apparently very helpful when your goal is to write resilient software