Convert the repository into a Java project
@christianbender @AnupKumarPanwar @dynamitechetan
This is something which something which we have discussed in the past and have been raised by multiple users of the repo. The repo can be converted to a complete Java project with correct package structure, JUnit tests and Java language standard checkers. I want that anyone who is adding a new algorithm should add respective tests and follow a set coding standard so that the repo can become more usable for users who can then clone it into a local IDE and work on it.
Similar to Scala Repo
I propose that we create a development branch on which we can start making the changes and replace it with the master once it fulfills the above-mentioned requirement. I would like to take the initiative and start this task.
Please share your feedback.
Actually converting the repo into a Java project will not solve the purpose of this organization. We want to create this organization as an open source learning resource for data structures and algorithms which is easy to understand for beginners also and every program is capable of independent execution. This will also make it convenient to automatically fetch the code and execute it in case we go for building a website for learning the DSA.
I've added a PR #815 that cleans up the code base to make working on it easier. After it gets merged I'll start with adding tests and all missing algorithms to the repo.
is this still going on ? If yes, I want in on it !! Which algorithms need JUnit tests ?
Just take a look at the development branch. Everything in there is OK. Everything else needs a port plus Junit tests
Just take a look at the development branch. Everything in there is OK. Everything else needs a port plus Junit tests
Here's a question before I dive into this. CombSort.java exists in the master branch, but doesn't exist in the development branch. So based on what you said, it needs a test, can you confirm ? and what do you mean by port ? Thanks
If it doesn't exist in development you have to get the code from master and add it to development. After that, you need to write unit tests for it. The tests should cover up most of the behavior of each algorithm. Like exceptions that might be thrown, wrong input formats etc.
By port I meant taking the algorithm from master and adding it to development. They need some tweaking because you don't need the main method anymore. The stuff in main should be covered by the tests. You also need to add package statements because the project structure changed to maven.
If it doesn't exist in development you have to get the code from master and add it to development. After that, you need to write unit tests for it. The tests should cover up most of the behavior of each algorithm. Like exceptions that might be thrown, wrong input formats etc.
By port I meant taking the algorithm from master and adding it to development. They need some tweaking because you don't need the main method anymore. The stuff in main should be covered by the tests. You also need to add package statements because the project structure changed to maven.
Great, thank you, I will get to it soon, I'm gonna do CombSort.java first.
I've added PR #825, which has 2 new files:
- CombSort.java ( copied from master as is, with minor changes to import statements and class interface implementation to accommodate project structure changes )
- CombSortTest.java ( which has 4 tests within it, Integer, String, Double, Character )
Looks good. Edit: Added some changes that you should make to match with java's coding style.
Hi all, I raised a pull request to change the build tool from Maven to Gradle. https://github.com/TheAlgorithms/Java/pull/902
Nowadays, Gradle is the most common build tool for new Java projects.
Is this still something that needs to be addressed?
Is this still on going task? If so I would like to contribute :)
Excellent Idea!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.