Programming Ruby 3.2 (5th Edition): B1.0 page 26, superfluous parentheses around condition

@noelrappin

First line while (line = gets) would be better Ruby as
while line = gets.
Even Scala 3 has been Rubyfied and suppressed these parentheses ! :slightly_smiling_face:
(In Programming Ruby 1.9 2010 edition p.24 there were no parentheses)

Same in Reading and ‘Riting page 30 :

while (line = gets)
print line
end

I think it’s current standard to put the parenthesis here to specifically call attention to the unusual bit of using assignment in an if or while statement (by default, for example Rubocop allows parenthesis in this case). And yes, I think the standard has changed since 2010.

Thanks!