3 ms·
I couldn't trace the origins, but I believe it comes a long way from C. In K&R it was used quite freely in the form of while ((c = getchar()) != EOF) In t
by xentronium 14y ago
I couldn't trace the origins, but I believe it comes a long way from C. In K&R it was used quite freely in the form of
while ((c = getchar()) != EOF)
In this particular case it's necessary because of operators precedence, although I can't remember whether they used extra parens when it wasn't necessary.
In ruby most style guides, including github's[1], are forked from bbatsov's[2], which had the bullet point about using assignment return value.
[1] https://github.com/styleguide/ruby https://github.com/styleguide/ruby
[2] https://github.com/bbatsov/ruby-style-guide https://github.com/bbatsov/ruby-style-guide