Burnout's other blog about stuff

the lack of a formal education

Upon occasion it might happen that I program something. Its mostly Python because this is the only thing I really know apart from some very early C/C++ days when I was around 15. But that doesn't matter, its still programming. I define a problem and then there is code that makes that problem go away or at least makes handling it easier. Most of the time its just simple scripts that raise data from one format to another. There are tools for that, I don't care and cherish the opportunity to write something. Its probably not a super efficient use of my time but usually the stuff is small enough in scope that I get away with it even on work. But there is sometimes something bigger, something that uses scary tools like an ORM, a GUI or even dependencies. Okay, the last one is a lie, there is always some dependency, no way I roll my own http stack or bother to handle date conversions my self.

But even the use of an ORM is somewhat newish to me, because I never formally learned to program or how to actually to informatics. Since the youngest of age I was curious and tried things. And when you bang you head long enough against a wall, one succeeds. Or at least I do usually.

A friend actually told me about it, of course I already heard about SQLAlchemy. And there are others (I actually went with Peewee because I had a good example and it seemed simpler). So I expanded my knowledge a bit. I tried, tested and found that I was previously a moron. As its always when you learn new ways you fought for so long against.

Anyway. The other day I decided that the current budget app on my phone isn't it anymore and I want a different one. One where one can export the actual data without downgrading it to csv. So I went and researched, found the very nasty Paisa whos devs are literal scum and went on. While analyzing their backup format I noticed that they used UUIDs as identifier. No problem and I just copied it, did some basic scripting and was done. Then I discovered drama, got angry and ventured on.

I found Cashew and again had to cut back in features, maybe I should really learn how to do android apps to be able to contribute every time I find some app lacking. But it was still good enough and true Open Source. So I opened their database scheme and took a peek. And again I found UUIDs. But actually not exclusivly. There were also the default entries that used normal INTs, all saved in a STR field in the SQLite. Weird. But there must be a reason people use UUIDs.

I know what they are, or rather, what I knew was "they are super unique and there is basically no birthday problem and one can create them offline without ever having to fear a collusion". Its a single user SQLite database that got no server infrastructure. So in this case I just assume that the creator was not actually considering the pros and cons for this specific decision but instead just did whatever the framework in charge proposed or what they learned back in school.

At this point I actually searched for it and found the first link to Stackoverflow. To save you the click, its:

Advantages:

Disadvantages:

Another user also pointed out that the moment a JOIN enters the stage everything slows down by a lot. Also the database driver should probably support UUID as a data format otherwise the actual data on disk is quite large for STR fields. SQLite does not have that and its a budget app..there are JOINs, actually quite a lot of them judging by the factor that the transaction table has five foreign keys.

I now think that I know enough to make a judgement and that the creator of Cashew either didn't care or maybe knew about it but judged that the real world performance will never be an issue. And I can respect that. Although, after my first round of imports, my old phone lagged a bit with 5400 transactions under the hood. But I have no way of telling if this is related to the use of non-incremental INT ids.

So its better than I never got schooled about proper programming and therefore am able to question decisions. Am I so proud of my ability to be able to do what I do because I am oh so intelligent? Am I better than all those college kids?

Not even a bit, I am frustrated as hell. Maybe the Cashew Creator did learn in School that UUIDs are the superior identifier by some passionate instructor and that stuck with him. I could ask, but I think that would be rather upsetting and I see no way of asking that without sounding at least a bit condescending. Also I like having the vague atmosphere of not knowing. And for every case like this, where I am somewhat sure that there is a sub-optimal choice being made, there are ten cases of me reinventing the wheel because I never heard of a concept. There was a case a few years back with a work problem (a beginner project where they gave me a lot of time to try out things) where I was racking my brain about a math problem and in the end I came up with an rather lengthy algorithm that worked perfectly. Turns out a one liner had done the same job:

list([list(v) for v in itertools.product(*variants)])

I don't know the first thing about itertools. (I also learned about generator expressions, but at that point they were rather new) Its not like I had an introduction course to Python. I just started using it, repeating the same patterns I learned elsewhere and searched my way through examples to achieve what I was looking for. And I become better, slowly, if I have enough energy on that specific day and enough time. But not always. But overall there is progress and I think that is good. But I also have to mull over how much better and faster I could be if I wouldn't reinvent the wheel all the time.

To wrap this up, of course could I join some introduction course about the basics. But I already know half of it, maybe more, so most of the time it is not only boring but also a waste of my time. And that is a dwindling resource these days. But finding the delta of my knowledge is impossible without being exposed to the total sum of everything.

And so my frustration persists.