February 2022: A (Not So) Quick Foray into Kotlin (Part 1)

Ah, yes. The good old mobile app. It's ubiquitous, really. And yet I've never seriously tried writing one. I've always despised having to force my will upon a rendering engine that refused to cooperate, but then again, I've always tried to avoid learning a dedicated programming language for app development. However, I suspect I really have to bite the bullet on this one and accept, that these tools have their place, and if I don't want to do a bunch of extra work on the frontend, I'd better start getting with the times. I've been told in the past that Swift might be an option for app development, but I don't like the whole Apple joint, so I'm going to default to something I've seen a friend of mine use on occasion: Kotlin.

Now, people who know my general opinion on programming languages might cock an eyebrow at this and ask, whether I've learned java while nobody was looking, and indeed, I haven't, and I don't really plan to if it can be helped in any way. Of course I suspect there will be a good number of java basics I'll have to pick up to effectively use Kotlin, but that's a price I'm willing to pay. Now, I don't really know anything about Kotlin going into this, including whether or not I'll need a java-esque editor to effectively program a Kotlin project. I've only seen it run on CentOS, a system I don't use (willingly). Seeing that I'll expect to miss the first week due to life-related things, and I've got a long history of breaking things on my machine, I'll set the target low and give myself time to escalate as things go on.

Considering that at the time of writing I'm very much too lazy to host any proper servers for anything, including this blog, I'm hoping to write something entirely offline, with a working, sufficiently bugless interface. For that aforementioned low target, I'm thinking of maybe going very basic and aiming for a tic-tac-toe game? If I get that done, maybe I'll think of a more engaging time-waster.

Week 3

Yikes. Okay, so I expected to be generally short on time this month on account of university shenanigans, but I also hoped to have fared better in the everything associated with learning a programming language. Were one to ask me why I dislike writing Java, one of my chief complaints would be the CLI. Writing a Java project with an interface often requires a pretty extensive project structure I usually like to ignore. What's worse, if I actually want to run a Kotlin program, chances are, that I'll have to use android studios too. There might be a method to circumvent that... thing, but I couldn't be bothered to try. That does mean, that I'm having to stare at really small text while coding, because native 4K resolution on a 13 inch screen just renders programs like that really tiny. That's better than too large text, I suppose, but what really bothers me is the debugging engine.

It's bad. I don't know, whether that's because of the structural component of the xml just doesn't parse well with the compiler, but if something doesn't work correctly, it doesn't tell you the line, or the specific file.

So what did I do this week? Basically, I just managed to set up android studios on my machine, which wasn't trivial, because I had done stuff to my some of my system configs android studios didn't like, and then I more or less just followed a video Tutorial by Code with Cal, programming a very rudimentary calculator app. Effectively, I suppose I learned the Java syntax, and the project structure of a Kotlin App. I also ran into some trouble wherein my installation of android studios behaved somewhat differently from Cal's, so I had to hunt down my includes as the errors rolled in. Usually I prefer to just play around with the software, and maybe check some basic syntax at w3, but since programming an interface was kinda the point of this exercise, and I have this strange inability to use Java editors from the get-go, I thought a video tutorial might have been more expedient than trying to cobble together the layout. I have tried that approach for PyQt in the past, and while I can say that I now understand how to disassemble an interface, I can also say that it was a long-winded, not too rewarding process. Still, I think I might prefer the Python way to the XML way. Maybe, because Python code forces me to think about the structure while I'm writing it, while XML looks to me, like I have to know what I want it to look like beforehand. And my relationship to planning is tenuous at best.

The tutorial made most of the actual coding relatively painless, mainly because I'm not too familiar with the datatypes Java or Kotlin uses. I'm not actually sure whether this is a Java thing, or maybe just Kotlin specific, but Kotlin code requires C-like variable dimensions, the same with function returns. Theoretically, the next step would be to go do a simple project without a tutorial. I guess I can try, but honestly I'm not seeing myself getting that done, because I haven't actually emerged from the swamp of muons at sea-level that have been the latest thing eating most of my productive time yet. Unfortunately I suspect it might look similar in March, so that does not bodes well for these little mini-projects.

Either way, I can very resolutely call this one a failure. No hard feelings, I guess, sometime there's really just not enough time, but maybe this means I should keep a score-card for these?

Having said as much, there is of course the ever important question of what do I do now? Well, I don't have anything lined up for next month, so I'm going to try and give myself another month to finish this mini-project of mine, even though, as mentioned above, I'm probably going to be about as busy in March as I've been in February. If that goes south as well, I'm probably not going to make a Part 3 directly afterwards, but hey, at least I have a calculator now.

Previous
Previous

March 2022: A (Not So) Quick Foray into Kotlin 2: Electric Boogaloo

Next
Next

January 2022: Composing Mr. Radio