4 ms·
"The same" means "ruby as pseudocode is the same as perl". You need to explain that 0 is True. You need to explain blocks, (int_number).times and other cute t
by Ingaz 14y ago
"The same" means "ruby as pseudocode is the same as perl".
You need to explain that 0 is True.
You need to explain blocks, (int_number).times and other cute things.
And I heard a lot of complains for whitespace, but begin-end is more irritable for many.
- technomancy 14y ago> You need to explain that 0 is True. Easy: it's not C. The idea that zero is false only makes sense if you're trying to code very close to the metal. To everyone else it's baffling.
- philwelch 14y ago> "The same" means "ruby as pseudocode is the same as perl". Right, except none of the reasons you gave for why perl is a poor pseudocode apply to Ruby, so you need to make that point yourself. > You need to explain that 0 is True. The truth values of integers don't usually come up in pseudocode. > You need to explain blocks, (int_number).times and other cute things I agree that the concept of passing around a block of code is hard to implement in less expressive languages, though cases like "each" and "map" can be simply translated to for loops. You could make the same criticism about Python's lambdas or list comprehensions. n.times is perfectly useful pseudocode, though. Think of it as a shorthand for "for(i = 0, i < n; i++)".