News for hackers. Stuff that matters.
Re:An Ode to Ruby by knodi123 on Monday January 10, 2022 @12:05PM (#29877860)
> still seems inconsistent to me (putting the function before the array)

I'm experienced in ruby, and learning python for a project. I don't think I'll ever not wince when using python's ternary;

ruby: size = (waist > 30) ? 'large' : 'small'

python: size = 'large' if (waist > 30) else 'small'

Re:An Ode to Ruby by cle on Monday January 10, 2022 @12:31PM (#29878306)
I've always assumed this was to maintain syntactic consistency with comprehensions like [x for x in arr if x > 2].