Skip to content

Comment on Why Go Can't Tryparent

Comments

I actually think it defeats the Go teams stated purpose. It may technically be "more explicit" but it causes too problems. First someone is far more likely to just use the old value, _ trick bedside the current usage is just so annoying. Secondly, it conditions a lot of devs to just skim over the if check, because half the damn time it's just bs.

A little syntax sugar that won't break backwards compatibly and makes the intent of the code clearer is a win-win. I've never seen a really reasonable response from the Go team on why they don't want to do it.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.