3 ms·
I would argue that is a good thing since it allows for performant access when you do not care about order. If you do not care about order you do usually not eve
by jeltz 6y ago
I would argue that is a good thing since it allows for performant access when you do not care about order. If you do not care about order you do usually not even have to allocate an array which means lower memory use. And how hard is it to write.
Dir[path].sort
Ruby lacks polish in certain areas but this is not one. A d I would argue Python can be pretty tough in places too.
- raverbashing 6y agoNot that Dir, I mean as in .methods/.instance_methods (or dir(instance) in python ) I fixed it in my original comment
- jeltz 6y agoThen I understand your complaint even less. I almost never sort the output from methods and I do not think I have ever sorted the output from instance_methods during my over 10 years as a Ruby developer.
- raverbashing 6y agoPython orders it. And when you want to look up a method by name you do a binary search by fact of being a sorted list
- fomine3 6y agoAnyway you can just .sort