|
|
|
|
|
by nirvdrum
4899 days ago
|
|
I'm expecting core methods to change either, as that would undoubtedly break programs. Incidentally, this would be kinda funny because the argument about your program being written poorly if it fails with such a change would be turned on its head. But, in any event, to pretend that Ruby was a perfectly designed language and couldn't possibly have warts is weird. Also, I never said "convention over configuration," since there's nothing to configure here. I was talking specifically about the convention of what a "?" should return. In that same quote Matz also says that predicates typically return a boolean value, but it's not required. That seems to both imply and endorse a convention. |
|
Sure. The convention endorsed is "should, but not required". That's exactly what happens. A pattern I see often is something along the lines of
which returns nil in the case the url doesn't start with https and a matchdata object if it does.