News for hackers. Stuff that matters.
Re:Delimiter-first code by allknowingfrog on Friday December 09, 2022 @11:51AM (#33923492)
Ruby has an interesting syntax for defining arrays of literal values.

  irb(main):001:0> sections = %w(one two three)
    => ["one", "two", "three"]
Re:Delimiter-first code by pmontra on Friday December 09, 2022 @01:01PM (#33924415)
I know and it works on multiple lines too. However I never use it. Requirements change, refactoring happens, one of those literals becomes an interpolated string and all of a sudden I have to rewrite all the array. Furthermore %w() is just not nice to look at IMHO.