News for hackers. Stuff that matters.
Re:Please, kill your darlings by knodi123 on Tuesday March 08, 2016 @12:36PM (#11246856)
Why use "map!"? you're already working on a disposable copy of your data, there's no need to mandate "in place".

Could this be done with one gsub regex?

why use "x = x[0..0].upcase << x[1..-1]", instead of "x[0]=x[0].upcase; x" ?

And why not use the already-written "titleize" function, which capitalizes the first letter of each word?

Frankly, I think your darling needs to be put out of its misery. :-)

Re:Please, kill your darlings by boxidea on Tuesday March 08, 2016 @02:52PM (#11248000)
> already-written "titleize" function

Which is a function provided by ActiveSupport. It's not part of Ruby itself.