50 karma · joined Feb 29, 2016 (10y ago) · 11 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
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.
comment 3y ago · link · parent
This is similar to how Icon works: https://en.m.wikipedia.org/wiki/Icon_(programming_language)
comment 4y ago · link · parent
enum Value {
Fizz,
Buzz,
FizzBuzz,
Number(usize),
}
impl std::fmt::Display for Value {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Value::Fizz => write!(f, "Fizz"),
Value::Buzz => write!(f, "Buzz"),
Value::FizzBuzz => write!(f, "FizzBuzz"),
Value::Number(num) => write!(f, "{}", num),
}
}
}
const fn get_fizzbuzz_equivalent(number: usize) -> Value {
if number % 15 == 0 {
Value::FizzBuzz
} else if number % 3 == 0 {
Value::Fizz
} else if number % 5 == 0 {
Value::Buzz
} else {
Value::Number(number)
}
}
fn main() {
(1..100).for_each(|num| println!("{}", get_fizzbuzz_equivalent(num)));
}comment 5y ago · link · parent
Actually there are labels (and what's the difference between a tag and a label?)
> [...] there’s no automatic organization here
When you get an email from a new contact you decide where it (and future emails) should go; you can also change the destination after it has landed in your Imbox.
> It is Slow & Ugly
This is very subjective: I like the UI a lot, and I've never perceived any slowness (Gmail, on the other hand...)
comment 10y ago · link · parent
The thing that people fail to grasp is that (almost) everything DHH writes is in the context of "when your application looks something like Basecamp" :-) I've been following 37signals/Basecamp since 2002, I think (long before Rails) and they've always made it clear that their opinions/advice are _not_ universal, because they only speak from experience - _their_ experience. So, if you're not in a similar situation as theirs, then of course their arguments are going to look strawman-ish to you.