2 ms·
> "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
by 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++)".