News for hackers. Stuff that matters.
Re:Rails is not written in Ruby by pmontra on Saturday February 05, 2022 @02:29AM (#30218709)
After years of Python I can't remember which one of these are correct

  1 ",".join(["a", "b"])
  2 ["a", "b"].join(",")
  3 ",".split("a,b")
  4 "a,b".split(",")
These method names feel like active form so 1 and 3 should be correct but it's 1 and 4 despite "a,b" obviously is not splitting "," but it's splitted by it

In Ruby it's 2 and 4.

I'm out of luck twice but at least Ruby has a and b always to the left and the comma always to the right so I always remember it.

There are no comments on this comment yet.