|
|
|
|
|
by ascar
2751 days ago
|
|
But you have to know if the boundaries are inclusive or exclusive, which leaves you with four different possibilities. You and everyone who reads your code needs to know this. Ruby is my main language and I would have to look up the boundaries of this function. Your "explicit" statement is also so much worse than using `x < 5.0` or `x <= 5.0`, depending on what you want. This is terrible advice imho. |
|
Anyway, ranges are another way of expressing the concepts in Ruby:
or if I don't mean None of which is advice. Just remarks about why I am enamored of Ruby, lately. If I wanted to write C, I'd use Go.