AbnerSquared / Orikivo.Classic

Orikivo's source code before its rewrite.
2 stars 4 forks source link

Simplify and refactor template builder #5

Open AbnerSquared opened 4 years ago

AbnerSquared commented 4 years ago

The original TemplateBuilder class used an extremely verbose and confusing method. Simplifying this method would make it easier to make changes.

jordihereu commented 4 years ago

Hey @AbnerSquared I can take this one if you want. I can refactor the TemplateBuilder.cs.

My proposal will be start by splitting that long code into small functions.

I saw that the class is static ( I don't know the reason why) an option will be to convert it into a non-static class so then it could be easy to implement unit tests for it.

To be honest I don't know how to execute the code so it will be nice if could give me a hand on that to ensure my changes aren't breaking anything.

AbnerSquared commented 4 years ago

@jordihereu Yeah, if you want to assist in this, you can!

I'm going to verify with sermetk's pull request first to let those changes go through, so it can be a bit easier to work with.

As the README.md states, this code project is very disorganized, with a lot of messy code files. Since I'm already using a completely rewritten version of this old library, my goal was to clean it up to have it exist as its own version.

The class was static at the time, due to how easy static classes can be referenced without dependency injection and such. This is the library for a Discord bot using the Discord.Net library.

If it helps, the pre-hacktoberfest branch has all of the files in a much cleaner code structure to make it easier to navigate. I'll give you the steps to launch this in just a moment, since I believe the code is currently invalid due to errors.

jordihereu commented 4 years ago

Ohh I didn't saw @sermetk merge, so my code cannot be merged :( Good news is that now I learned how to use as Origin the original project (instead of my fork), so I can fetch changes easily from master, Ok I'll check later if I can still refactor something in TemplatBuilder. after latest changes. Ignore my PR.

AbnerSquared commented 4 years ago

Alright! Sorry about that, I was trying to get his in before you started work on yours.