Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Like goto, unwrap is just a tool that has its use cases. No need to make a boogeyman out of it.




To be fair, if you’re not “this tall” you really shouldn’t consider using goto in a c program. Most people aren’t that tall.

Nonsense. Linux kernel for one example, uses goto everywhere for error handling.

How many codebases besides the Linux kernel had you seen an intentional amount of use of goto?

The answer is one search away on GitHub.

I will give you one example though: various .NET repositories (runtime, aspnetcore, orleans).


Yes it's meant to be used in test code. If you're sure it can't fail do then use .expect() that way it shows you made a choice and it wasn't just a dev oversight.

panicans should be using .expect() in production



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: