I agree with sawa's comment - this is a bit surprising, at the least to me as well. It would
be better to re-use the same idioms, so that ruby users are not surprised by behaviour, if
it can be avoided.
But I think this is only one part of the suggestion; the other is about a simpler API,
at the least that is how I understood it in the context of the example here.
I have no particular pro/con opinion per se on the proposed functionality; I have had
to deal with time stamps in audio/video code too, so I understand the requirement to
work with milliseconds, including making this data available to other languages or in
e. g. json or yaml - but in general, ruby may have to be a bit conservative in what is
exposed to other "downstream" ruby users API-wise. For example, some time ago :exception
added to some methods, which I think was a good/useful change, at the least for those
ruby users who may require the functionality; ruby may have to be somewhat conservative
in what may be exposed API-wise. It may be difficult to memorize 1000 different
symbols. :D
Perhaps in the long run we could have something similar to require 'English'
, defining some
useful "decorator" symbols, such as in the example given above, via unit: :milli
, and then
"decorating" methods with this, when they meaningfully use time-related code - but I think
that this may require some more discussion in general. Matz also made comments about this
in the past in another context; I don't fully recall the idea, but I think it was somewhat
related to "interfaces" to methods or method signatures or something like that.
I wanted to write a bit more, e. g. giving the example of ruby-gtk using more symbols,
such as :bold
rather than harder-to-remember Pango::FontDescription::BOLD
, or something
like that, but I think I already wrote too much, so I will stop here.