benjaminbhollon / see-with-eyes-closed

The code for the See With Eyes Closed blog.
https://seewitheyesclosed.com
GNU General Public License v3.0
3 stars 0 forks source link

Use OOP to ensure easy maintainability #2

Closed zmontgo closed 3 years ago

zmontgo commented 3 years ago

Separated CRUD, GET, and POST functions into modules that use classes to share variables. Ensures easy maintainability and easier to read.

zmontgo commented 3 years ago

Currently still in progress. Class methods called in an ugly and not future-proof way, hope to update it to call all class functions automatically. Maybe not all modules imported for the /classes/ files. Marked PR as draft.

zmontgo commented 3 years ago

This is still broken but I have been unable to test it for this entire day. I will test it when I am available again, but until then just have a bit of faith in my coding abilities haha.

benjaminbhollon commented 3 years ago

Hee hee, so I actually just did some of this already over on https://github.com/gamified-reading/gamified-reading and hadn't gotten around to porting it over here yet. Could you take a look at that code and see if it would solve your problem? If so, I'd prefer it since it's much more streamlined

zmontgo commented 3 years ago

Actually yes, that's very good. One thing, I'd want all the functions, as well as the GET and POST requests, to be in separate modules. Would that be possible?

benjaminbhollon commented 3 years ago

It might be, but the way you did it feels a bit messy. All the original code is still there, but I have to do an extra function call. I'm planning to look around for good ways to do that.

benjaminbhollon commented 3 years ago

Alright, I'm going to re-code this with the things we've learned now. I'll give you co-author credit in the commits