I actually have no idea if it's good practice to make a main just a wrapper around other stuff?
My first thought was hey I can split this into three different files, that way the "main" (entry point) is like 75 lines, but really that's not actually helping the problem of bloat, I have to fully redo this.
Going from 2,300 lines of code down to who knows, but a lot of this is junk, methods rewritten twelve times commented out 11 times, bits from libraries I am not going to use, so that's really not an accomplishment. Anyone who judges programming progress or competence as "number of lines written" is a fool. And you know who I am talking about.
I'm now ten revisions in and I think it's as good as it's going to get. However I need to cut some of this code out and fix the ugly hacks.
After five revisions I'd say I'm at somewhere between 72 to 87 percent depending on the image. Maybe I'm approaching it wrong - maybe I should be separating out *everything*- foreground, background, also every little whatever, section etc.

Libertarian Debate - Driver's Licenses (Extended)
YouTubeThe challenge right now is can I separate out foregrounds and backgrounds. In a non-flattened PDF? Easy. In a flattened PDF, or a JPG, or PNG, that's the challenge. I'm considering things like distance from border, clusters of colors. I'd like to say I'm getting somewhere three revisions in, but really I can't say I'm getting anything but "okay" results. I'm sure there's a library that does this all automatically for me.
#python #programming #codingWhatever your opinion on
#Google #Android side loading, a lot of comments on places like twitter and reddit sound like that dude who was like "a license to drive a car? What's next, a license to make toast in my own toaster? They're all like it's MY phone I bought with MY money and I'll do what I damn well please like okay edgeboy relax it's just a telephone it'll be okay nobody is taking away side loading from you specifically.
What I'm doing now is, trying to future-proof so I'm keeping track of both the file extension and the mimetype. My feeling is that, the file extension *should* be enough like 99% of the time, right? The other thing I'm doing is calling .lower on every file extension, I feel like that's part of just avoiding annoying bugs.
One I guess annoyance in how my brain handles code refactoring is, as more features get added, previous assumptions go away. I used to only accept PDFs for all modules, then I added sometimes accepting images, so I added a "module_can_accept_images" boolean (via a list I "for in"). Really what I should have done is say "these are the types of files/file extensions this module can accept" and "for in" that list. Definitely one of those hindsight moments.
#programming #coding #python