HackerTrans
トップ新着トレンドコメント過去質問紹介求人

bakhy

no profile record

コメント

bakhy
·2 年前·議論
This looks too easy, the first solution. If there is no logged on user, which User object is fetchUser going to return? Which friends? At the top level, if I were to forget to check if someone is logged in, who knows what would happen here.

I've worked on codebases where people were so allergic to the "billion dollar mistake" of nulls, that they created empty objects to return instead of returning null. This bit us in the ass a couple of times, e.g., when caller code was mistakenly passing the wrong ID variable into a fetch method, and just happily continued working and writing garbage into the DB, because it did not realize that its fetch had actually failed. It took data from the empty result object and happily continued its computation with it.
bakhy
·3 年前·議論
The same site has an article about all this from today: https://www.icelandreview.com/business/elon-musk-and-halli-s...
bakhy
·3 年前·議論
It's also available as an Android app, MaximaOnAndroid. I love having it on my phone, even though I rarely actually use it :)