Brian Candler wrote: > Seebs wrote: >> Or is there something else in the new String that you don't like? > > It's as complex as hell. I took the trouble to document about 200 > behaviours of String in 1.9, and I still haven't really scratched the > surface. http://github.com/candlerb/string19/blob/master/string19.rb > > The scariest bit for me is that a simple expression like > > a = b + c > > (where b and c are both Strings) can raise exceptions. So what? > Writing your > program so that you can be *sure* it won't raise an exception is hard. Not at all. That's what rescue is for. > Even the same program running on two different computers with the same > version of ruby 1.9 and the same input data may crash on one but not on > the other. > > I don't want to have to expend effort working around artefacts of the > language, especially when dealing with binary data. Binary data doesn't belong in Strings. Period. The only reason you have it in there in the first place is that 1.8's piss-poor String handling allows you to treat strings as byte arrays. I haven't used 1.9 yet, so take this with a grain of salt, but my impression is that encoding-aware Strings that aren't byte arrays is exactly the right thing for Ruby to have. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen / marnen.org -- Posted via http://www.ruby-forum.com/.