HackerTrans
TopNewTrendsCommentsPastAskShowJobs

stefano_c

no profile record

comments

stefano_c
·3 ปีที่แล้ว·discuss
The "Variance of slice types" paragraph is confusing as hell. The type Tree implements interface Barker, after all. To me it looks like this is more about what I call "accidental implementation" (which is one of the many reasons why I don't like Go). Can somebody please explain what I'm missing?
stefano_c
·3 ปีที่แล้ว·discuss
The irony is that in a normal Rails app workloads are already split by default (requests and background jobs are handled by different processes that share the same codebase).
stefano_c
·4 ปีที่แล้ว·discuss
I've been writing Ruby for 20+ years and "unless" (the whole language, actually) immediately clicked for me when I first learned it.

That said, I only use it in 2 cases:

* as a trailing condition (do_something unless this), mainly for early returns * as the only arm of a multi-line block (unless this ... end, no "else" blocks - Rubocop would yell at me anyway)

And then only if the condition is either a simple value, or a combination of simple values (this && that, this || that).

That's it. Never had a problem with double negatives or accidentally inverting the logic.
stefano_c
·4 ปีที่แล้ว·discuss
I wish I could upvote comments more than once on HN :-)
stefano_c
·4 ปีที่แล้ว·discuss
> - There are no booleans in the language! Conditionals can still succeed or fail, but failure is defined as returning zero values and success is defined as returning one or more values.

This is similar to how Icon works: https://en.m.wikipedia.org/wiki/Icon_(programming_language)
stefano_c
·4 ปีที่แล้ว·discuss
> How about scheduling a daily summary email? Daily reports?

Forgive me if I'm wrong (I don't know Phoenix that well), but don't you need some external library like Exq do perform background jobs? How is Phoenix+Exq different from Rails+Sidekiq?