pnevyk / gryf

Graph data structure library aspiring to be convenient, versatile, correct and performant.
MIT License
69 stars 1 forks source link

Rename `builder.with` to `builder.using` #71

Closed pnevyk closed 1 week ago

pnevyk commented 5 months ago

Currently, the convention for specifying a particular algorithm by a runtime value uses with method on the algorithm builder:

ShortestPaths::on(&graph).with(Algo::Dijkstra).run(start);

I believe that using using sounds more natural and as better English (although I am not a native speaker):

ShortestPaths::on(&graph).using(Algo::Dijkstra).run(start);

Moreover, the word with is a common word for prefixing builder method (builder.with_foo) so we might want to reserve that in case we ever decide to switch to this convention.

This doesn't apply to compile-time algorithm specification, that is, the following example will remain unchanged

ShortestPaths::on(&graph).dijkstra().run(start);