3 ms·
After reading this kind of code for a week it becomes as easy as anything else. As long as there’s no pyramids of doom (possible with plain if else, promise .th
by vjerancrnjak 3y ago
After reading this kind of code for a week it becomes as easy as anything else. As long as there’s no pyramids of doom (possible with plain if else, promise .then and async/await and this optional and_then) code will be easy to read.
- NBJack 3y agoThat's true for many things we as humans can become accustomed to. But what exactly is the (hopefully quantifiable) improvement here? Otherwise, it's just a style option of preference.
- vjerancrnjak 3y agoIf you use the optional type, then nothing. It’s just style. If you don’t use it and your compiler can tell you’re dereferencing a possible null value, then again you gain nothing.