News for hackers. Stuff that matters.
Re:Rails is not written in Ruby by dragonwriter on Friday February 04, 2022 @06:17PM (#30214872)
I generally like Ruby better than Python, but Python's choice on _join_ being a string method on the thing stuck between elements rather than an collection method on the things whose elements are getting something stuck between is better.
Re:Rails is not written in Ruby by renox on Friday February 04, 2022 @06:33PM (#30215047)
Why do you think it's better?

I don't use either Ruby or Python but I think that the first way is more natural.

Re:Rails is not written in Ruby by renewiltord on Friday February 04, 2022 @06:37PM (#30215102)
Interesting. I model `array.join(',')` or the equivalent Py `','.join(l)` in my head as ultimately (pseudo-code):

    foldLeft(tail(array), str(head(elem)), (acc: String, elem: T) -> acc + ',' + str(elem))
Which makes the array method easier to understand than the string method. Funny how I thought it was _obvious_, but you find the opposite obvious.
Re:Rails is not written in Ruby by mcphage on Saturday February 05, 2022 @12:05AM (#30217731)
Why? somearray is the important piece, the string is just a bit of spacing. Put the important thing first, don’t bury the lede.