Tkinter, Python, Frag, Database, Projects, Integration

  • Sometimes I laugh about bad code, and curse others. But in this case the Tkinter crash issue was so hard to analyze and debug, that I finally decided to get rid of whole window frame and force the window to be top most all the time. Now the window frames close window button won't cause the application to crash, because the button isn't visible. There's alternate close window button in the window, which of course works. So user can close the application. Not very elegant solution, but solution. Because getting rid of the crash started to take way too much time. - This is a good example about surprising and extremely annoying thing, which anyone would say by default, it's easy, quick and trivial. Yet it isn't. This is exactly why work estimates are so bad things. Because getting some extremely small things can take more time than everything else together. As example in this project, the Tkinter crashing and COM Interface code, has taken much more time combined than rest of the code required for this specific project. - Anyway, I think it's related to the Window class and It's references to self.root, and so on. Probably could work if I refactor code and make the application itself subclass of the Tk. Probably if the application Window would be the root itself and subclass of Tk, then it could work. - But because I've already found working way, I don't have interest to investigate this anymore. Maybe next time if such solution is ever required again. - This bothered me so much, so I made the changes required to make the class child of Tk. Nope. Exactly same issue, cancel button works, close button crashes. Even if the close handler is same as the cancel buttons handler. So much fail.
  • Similar thing happened with the binary data PUT with Python. I decided that we can just encode the data, so it isn't binary. And therefore avoided the binary data handing issues. But in general, I think it's issue with standard library, that it doesn't work with binary data and expects input to be strings all the time. So why use PUT if you can use POST instead. Yes, I'm aware that there's extra overhead, but so what. Making PUT work, would once again take too much time, compared to the kludge workarounds it would require and time consumed to do that.
  • Filefrag (Linux tool) doesn't work with exFAT. Hmm. Ok. I think I've mentioned this earlier. Anyway, Auslogics Defrag is good for exFAT unless you'll just do the traditional way of defragging. Which is moving data to another drive, formatting the drive and moving everything back. Which might not be perfect after all, especially large directories tend to re-fragment immediately anyway.
  • Played and experimented with database tables, relations, references, and cascade on delete. kw: SQL, ON DELETE CASCADE.
  • One thing I really hate as project approach. Is the tendency to deceive customer by giving impression that something is great when it isn't. As well as after that constantly down playing customer expectations and requirements. Sure, I know this is made in every industry. It's just kind of game, who gets tired and stops complaining first. And avoiding getting the job actually done. But still, it doesn't make it less irritating or annoying at all. All the effort wasted on negotiating and discussing matters, which has been agreed ages ago about. Even written in documentation. - Sigh... - It's just like the renovating guys doing everything badly, and after 10 complains, they fix one thing poorly. Then more complaints and then it's bit better and... Yeah, sure it's still totally subpar, but ahh.
  • Integration and code quality, data quality, processes, etc. I wasted some time trying to get system inconsistencies fixed. Truth is that if you find something being broken, just add extra code to work around the issue. Don't waste your and everyone elses time, trying to get the root cause fixed. It's long and very wasteful path and probably will still lead to the resolution that it's just better to add some adhoc workaround. - Because that's the simple and fastest way of dealing with the issue, requires no other changes, nor wastes time on communication, etc. - Just get the thing working and stfu.

2019-06-09