News for hackers. Stuff that matters.
Re:Ask HN: Good C++ code bases to read? by kentonv on Wednesday October 28, 2020 @05:12PM (#24924210)
kj::Maybe has an `orDefault()` method that is like `.value_or()` but I find that it is almost never useful. You almost always want to execute different logic in the null case, rather than treat it as some default value.
Re:Ask HN: Good C++ code bases to read? by CyberRabbi on Wednesday October 28, 2020 @10:30PM (#24926454)
Then you can make a quick helper subroutine that adds a monadic interface to optional and you can lint away all non-conforming uses of optional.