-
Notifications
You must be signed in to change notification settings - Fork 14
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
Create most used functions lib #6
Comments
Hey, @murilocamargos. And in that case, we should always strive for the most performant and efficient algorithms possible, since we'll be relying on these functions for the other problems. What do you think, @fredericojordan? |
I created this pull request with an example in Elixir. Is this sort of what we want? |
Although it's nice to have these functions readily available, I think that coming up with them is part of the fun. |
This would be only the most used functions. From what I've seen solving some problems, having a function for checking if a number is prime or not wasn't a decisive factor to actually solve the problem. Also, I think having a helpers file doesn't stop you from optimizing them as well, this would actually be encouraged! |
Well, I guess we can sort of be in the middle on this one. We can have the directory but everyone is free to use whatever algorithm they want, given that the answer is correct. How does that sound? |
What is nice about this is that we can discuss the algorithms out of the context of the problems. |
Sure! Why not? |
Can I join the discussion? I think what is nice when you finish your problem is looking at the forum and trying to find someone that thought what you done before you even started the Project. My point is: I think we can create a directory inside the project with some categories. Nevertheless at my point of view this should be well documented. Copy and paste code is never fun as understand how that code works and what's going on with the code that you just saw and we can compare 'same stuff' on different languages. |
My only issue with this idea is that sometimes there are slightly different goals in each problem. For example, let's say one problem needs the fibonacci number at certain index while the other only has to generate them continuously. |
Specific to the case that you(@fredericojordan) described, finding a Fibonacci number is a single problem and can be isolated. The specific part of the problem can use some 'black box' of a Fibonacci number generator. Of course, that is my opinion. I think the decision should be made on the project big picture. |
There's a lot of problems in Project Euler that relies on the same kind of operations, e.g., prime testing, prime generator, fibonacci sequence, and so on. It would be nice to have these kind of functions in file shared by all solutions as a lib.
What you guys think about that?
The text was updated successfully, but these errors were encountered: