Better HN
topnewbestaskshowjobs
Log inSign up

IAmADHDToo

2 karma · joined Dec 8, 2020 (5y ago) · 4 submissions

Submissions

comment 5y ago · link · parent

> With a while loop, to know what happens at the bottom of the block, you only need to check the top of the block.

Anyway, what could possibly happen at the end of a while loop, besides going back to the begining for the test?

Besides, if you have a bug in your code, you will have to look at the whole block anyway.

comment 5y ago · link · parent

That's indeed tricky: if there's a for loop inside the guarded block which generates many defers, a stack would have to be created to handle them somehow.

comment 5y ago · link · parent

> I don't get it. These are literally all exactly the same thing, all slightly varying in ergonomics and compiler support. They may differ slightly but to call them two different categories of solution is just creating a false dichotomy for yourself.

Option types can be nested, nullable types cannot.