Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
This is a prime example of when NOT to use stream also how the fuck do you pronounce that name
-
@BindView lucks me nur (nursery) psy ah
it is hard for me too, to get the part after 'S' -
feluelle697yYou could use "optional". For example ifpresent or getifpresent etc. when using stream api.
-
Coming from Haskell, it would be something like: getById i = listToMaybe $ id >>> (== i)
Yup that's a list filter, comparison, a "get first", and an optional return type... and can be applied to any data structure with an id. -
@bittersweet its so inconsistent. No it doesnt cause problems (haskell💚) but come on, its like you dont know the code you write.
-
@BindView Maybe is godsend when interacting with external data.
Database, fetch me the first user who loves the color pink — database query function responds with "sure thing I'll look for it, and MAYBE I'll find you one".
Maybe is a superior "result or null". It's an exception which doesn't need to be thrown or caught. It's the simplest monad, and the easiest way to start understanding monads.
Related Rants
We Indians are more than SMART
rant
java
javascript
india