HackerTrans
TopNewTrendsCommentsPastAskShowJobs

lixquid

no profile record

comments

lixquid
·2 mesi fa·discuss
I believe they mean token costs aren't a concern when you're not paying for a SOTA model via API, and are instead running local models.

Infinite monkeys on infinite typewriters, and all that.
lixquid
·2 anni fa·discuss
Why wait until then? The loudest and earliest crash you can get is a failure to compile with a rich type system (obviously, when possible).
lixquid
·2 anni fa·discuss
Program logic fundamentally has to contend with different conditions. Sometimes the user will be logged in and have friends, sometimes they won't.

The "maybe" style has the inconsistency embedded in the type system; it's impossible to have an invocation to getFriends and then not handle the resulting possibility of not being logged in.

Shifting it up to the caller just means that you're going to have to remember to ensure the user is logged in before calling getFriends otherwise you'll get some kind of error, which might give you more control, but now there's no guarantee in the type system that you've handled the case where the user isn't logged in.

Writing ifs everywhere to handle failure conditions might be a bit of a pain, but that's more of a failing of the language than the style.