-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not more object oriented? #23
Comments
Can you give an example for such a method? |
For instance, old:
New:
|
That makes little sense to me. The input graph is just a data structure and has nothing to do with the fast graph preparation or at least I see no reason to couple the input graph to the fast graph preparation like this.
This might be reasonable, but what about the usage pattern with I don't know I do not see a big improvement in changing these the way you propose. But maybe you can explain a bit how this would help or make things easier for your use case? And maybe have a second look at |
Changing the The |
Hm,
The path calculator constructor only takes an integer input (the number of nodes of the graph). But its true that the number of nodes passed into the constructor must match the actual number of nodes of the fast graph used in
This case is covered by this assert. So there will be an error indicating the wrong usage pattern: fast_paths/src/path_calculator.rs Lines 61 to 65 in f00b621
|
I noticed a lot of methods are used like this:
fast_paths::a_method(&graph, a, b, ...)
Whereas a more OO method call would look like this:
graph.a_method(a, b, ...)
Is there any reason the first is used so often? I would like to send in a PR to move over to the second way, but want to make sure it would be accepted.
The text was updated successfully, but these errors were encountered: