9 ms·
i like that because it's a string's method returning a string.
by gcb 17y ago
i like that because it's a string's method returning a string.
- nailer 17y agoMethods aren't defined by what they return. I have a host method (a property, to be precise) that returns a location of the host. It wouldn't make sense for it to return another host object. string methods are things you do to strings. list methods are things you do to list. Most people think of taking a list, and gluing it with a string, not taking a string, and using it as glue for a list.
- gcb 17y agogood points. I was pointing out mostly a subjective 'beauty'. just of note, the architect in me would go for 'why not have both?'