3 ms·
Worse nomenclature than any other big language I can think of, including Go and Python. Why should this package be called "algorithms"?
by Kednicma 6y ago
Worse nomenclature than any other big language I can think of, including Go and Python. Why should this package be called "algorithms"?
- iainmerrick 6y agoC++ has similar nomenclature - - the std::algorithms library has generic functions for working with collections: https://en.cppreference.com/w/cpp/algorithm https://en.cppreference.com/w/cpp/algorithm Whether C++ is a good model to follow is another question entirely, of course! But at least Swift isn’t being completely idiosyncratic in its naming choices.
- deleted 6y ago[deleted]
- coldtea 6y agoHuh? It sounds like it shouldn't be called anything BUT algorithms. It implements standard generic algorithms for various operations. The kinds you'd be asked about in an algorithmic test, learn in algorithms 101, and so on. Of course technically any part of a program is an algorithm, but usually (like here) we reserve the name for general things like here (from path and graph to partition and search algorithms), not for our "business logic" algorithm.
- summerlight 6y agoThese functions are designed to be highly generic so can be used as building blocks for many other more specific algorithms while it is not specifically tied to other concepts like container or iterator. Do you have any concise alternatives that reflect these properties?
- hntestacc 6y agotest
- happytoexplain 6y ago>a new open-source package of sequence and collection algorithms, along with their related types. This is exactly what algorithms are at the level of almost any language's included libraries. The name seems spot on.
- hntestacc 6y agosome more test
- jerome-jh 6y agoI agree this is a poor use of namespace. Python has that in itertools, Numpy has combinatorics and random sampling in numpy.random. Maybe they just planned to stop here? Or the algorithm namespace is bound to become overcrowded.