polytropica

why code?

I am a bit late, I think it's been almost a month since the last post. I've been finding it hard to work on any sort of personal project right now, as the YouTube demon is currently consuming all of my attention. But that changes now! I'm going to try and write something a bit shorter than last time (editing hexy: it is not shorter than last time, it is actually LONGER god why does everything take so many words to explain) well since that failed, enjoy another really long post. It's time for the second episode of "hexy tells you why you should do things", as we continue this series of "let's get unreasonably personal about things I care about".

so there was this cool video

This all starts from me watching this absolutely fantastic video called for-profit (creative) software by EndVertex. There are so many things that are amazing about this video, starting from the awesome 3D animation talent on display, to the way it depicts the absolute callousness of modern corporate greed, and the in-depth explanations of the technical details of animation and modeling software. And, not to forget the point of the video, what it means to have your gateway to creative expression shackled to a for-profit program that can change at any time. No description I can write could ever do the video full justice, so seriously consider watching the entire thing, it's 1 hour 15 minutes of your time and it is worth every second.

The part that I wanted to talk about specifically was the section on trying to fight back against "predatory software practices". The video goes over their frustration (and my frustration, btw) on the movement of major software towards subscriptions instead of one-time payments, always online software, and the inflation of price points of software to beyond the reach of the typical consumer. They suggest moving to free, open-source alternatives to paid software, trying to support those alternatives, as well as trying to learn platform-independent techniques that are transferrable if you need to switch to a new software.

On my last article, I touched on wanting to have something of my own and wanting to build it from scratch. Since that article I have become aware of "Build Your Own Fucking Birdfeeder" by Manul Laphroaig (yeah, I can swear on this site!) which succinctly describes why it is important to, as they put it, "build your own fucking birdfeeder". Wish I had put that in the last article, but oh well, I don't wanna rewrite it. Anyways, the reason I wanted to talk about my last article is because I feel like some of the thoughts around wanting to build my own things feel incomplete, and even this article doesn't fully round out why it feels so important to me, but EndVertex's video really put things into context for me, and I want to talk about that.

coding is power

Fundamentally, all software is code. There is a very complex chain of events that actually transform the code you write in a text editor to actual instructions the computer can execute, but at the end of the day everything the computer does is just code. What it means to be able to code is the ability to tell the computer what you want it to do. Computers don't really care where code comes from (although there are a lot of protections in place to prevent malicious code, I don't care about that right now), so if you have the skills to tell the computer what you want it to do, it will just do it. The corollary to this is that if all software is code, and the software doesn't work the way you want it to, you can just change the code, and make it work the way you want it to. The only thing holding you back from doing so is your ability to understand the code and modify it.

It is not actually this simple. There are a variety of protections software companies put in place to try to stop you from doing this. First and foremost, most projects are closed-source, meaning there's no way to view the source code and compile the project from scratch. There is some hope, however. As long as you have the executable, the executable is actually just a list of machine instructions to feed to the computer. These machine instructions can be decoded into a human-readable format called assembly with a program called a disassembler. The disassembly of a program is very far removed from the actual source code, as it represents exactly what the processor is doing without any of the context of the original source code. This is quite difficult to interpret without training in, but it can be done, and is the basis for a whole field of security called reverse engineering. As the saying in those circles goes, "everything is open-source if you know reverse engineering".

Companies also employ a variety of anti-reversing and obfuscation techniques to make their software harder to modify this way. Fundamentally, however, all obfuscation techniques are limited by the fact that all code must eventually become assembly, and assembly can be understood. This can be easily seen in the games industry. Major game publishers put DRM like Denuvo in their games to try to prevent piracy, but those games are inevitably cracked within a few weeks, rendering the protections pointless. It is not a matter of if some piece of software is crackable, but simply how long it will take.

I don't intend to advocate in favor of piracy, because that is a stupid thing to do with my public platform. You should pay for your software and support the people who actually developed it. However, if software doesn't work the way you want it to, or doesn't have the functionality you need, the ability to read and write code becomes the power to shape software to your will. I think a lot of software I use tries to shove in things I didn't want, or isn't formatted quite the way I like, or is just missing functionality I was looking for. Coding is the means by which I transform those dreams into reality. I think that in a world that often deprives us of the control we need to live our daily lives, this is one of the ways in which I do have control over my surroundings. This is my digital canvas, and I wield the brush.

Well, hypothetically. This is what I really want out of coding, but I'm not quite there yet. Real software is really fucking complicated and not easy to mess around with. I've dabbled here and there with adding features to big projects, but most of the stuff I've added has been pretty small. I've dabbled a bit with video game modding, but haven't touched things like browser extensions. This website and the video game I'm working on have been the largest software projects I've ever worked on, and they still feel like nothing compared to BIG software that millions of people use. Every day I spend coding, however, I get a little closer to my goal of being able to rewrite whatever I want how I want it.

a couple examples

What does it mean to be able to code whatever you want? What does it mean to have control over your software? I think some examples will make it more clear.

At the time of writing, my current computer runs Linux Mint, using the default Cinnamon desktop environment. I switched away from Windows 5 or 6 years ago, when I dual-booted Ubuntu 18.04 LTS on my laptop because I kept reading that Linux was the best environment to do coding in. It took me a hot second to get used to doing things through the terminal, but now it's second nature. Something really simple that pulled me towards Linux over Windows is the clock in the corner. To change the default clock format in Cinnamon, you right-click the time to edit it and you set a custom strftime format string, which the editor for helpfully redirects to the page I just linked. The default is "%A, %B %e, %H:%M" which gives you an output something like "Wednesday, October 15, 05:21". I hated this, so I just changed it to "%a %b %e, %I:%M %p", which looks something like "Wed Oct 15, 05:21 AM". This is wonderful. I love this. This is how things should work.

There is no way to format the date like this in Windows, I checked. Date and time displays are filtered by region (which seems like a decent idea), and you have to click a button to change the format settings, none of which give you an option to have something like "Wed Oct 15". I know this is a minor thing and I could probably live without it, but why should I when Cinnamon gives me the options I actually want? It's such a simple thing to get right, and it's one of the things that endeared me to Linux.

I didn't even mention being able to add custom applets to the taskbar and remove all the parts you don't want. On my laptop, I added buttons to the taskbar to lock/suspend/power off my computer. There's a "notification timer" applet that lets you set a custom timer and ring with a notification when it's done. How the hell do you do any of this in Windows? I don't even know how to turn off the Cortana thing in the taskbar. All of this is built-in to Cinnamon, by the way. This all just comes with the default setup. I'm not even coding in a new feature, this is simply having more control over the way I wanted my taskbar to look, and the OS actually giving me the power to change it. If I really wanted to, I could code my own custom applet to do the thing I want to do.

Something about Cinnamon that did require modifying the code for me was the alt-tab behavior. You can customize the format of the alt-tab window that pops up between a couple of presets, but none of them quite did the thing I wanted. The closest preset was something called "Icons and Thumbnails", which shows the icon for each app and a small picture of what the app looks like. The problem I was having was that I had to wait about a quarter second to see the thumbnail, and there was no setting to reduce the delay for this. After searching online for this, it turns out there is a way to remove the delay. It turns out Cinnamon is written in JavaScript, and you can just navigate to "/usr/share/cinnamon/js/ui/appSwitcher/classicSwitcher.js" and change "THUMBNAIL_POPUP_TIME" from 300ms to 0ms. THIS IS FUCKING AMAZING! I can understand JavaScript (i do js in this site). Granted, I barely understand what's going on in these files since I don't know how the OS works, but it's all just there! I can understand it if I wanted to, and I feel like that's the way things should be. In what fucking universe can you edit Windows system files to change the alt-tab behavior to something you actually like?

I didn't expect this to turn into a rant on why I hate Windows for incredibly petty reasons, but here we are. Maybe I should do a post about it. Tell me in the currently non-existent comments (comments are coming, i promise). I've got two more examples, and we can wrap this up.

One of the things that helps me get to bed on time is actually an automatic shutdown timer. The way I have it set up is that when the time hits 2am, the computer sleeps itself, and will auto-sleep every 5 minutes for several hours after that. I even have nice notifications warning me that the computer is about to be put to sleep. How did I do this, you ask? I wrote it myself.

There's a utility in Linux called systemd timers that a lot of default services utilize to do things at scheduled times, and you can just write your own custom timers and add them to the system. You can also send your own custom notifications with a terminal command called "notify-send". The actual timers themselves are ~30 lines of code, and I had to write a small python script to get notifications to have the text I wanted in them (that being the time and how long it is until 2am) which is ~50 lines, totaling to ~80 lines of code for the entire project. This now "just works". I have some issues with the notifications not showing over other apps that I need to fix, but other than that it works great.

Couldn't you have just found a utility to do it for you? Yeah, probably something like that exists, but you know, something something fucks and birdfeeders. Here's the thing though. Now that it works, I enjoy several advantages over just having someone else do it for me:

This is the power of coding your own things. If you can understand it, you can have complete control over it. Can you do this in Windows? Yes, it looks like Windows Task Scheduler is a thing you can use, and it even supports console commands. Wonderful, now how am I supposed to hate Windows? (to be clear, there are way more reasons not touched on in this post that windows is bad, i just don't care to list them)

last example

This last example is something that happened in real life, and is also one of the reasons I wanted to make this post. I go to a coding meetup semi-regularly, and on this particular day, me and a person I'm going to call K were the only people there. On this particular day, K was feeling kinda tired and just wanted to take a break and look at some blogs he hadn't caught up on. I, of course, came with my personal website project (yes, this site!). I think I was working on making a custom error page to replace the default Apache error page. They ended up getting inspired by me and they showed off their own personal website project (which I will not link because I like not doxxing people). They had this really slick SVG animation that displayed the word "anime", that they wanted to adapt to show off their own name, but had no idea how to do.

What is an SVG? It's something called a vector graphics format, which is opposed to the traditional raster graphics format. Raster graphics stores images as individual pixels, where each pixel has an RGB value associated with it. Most traditional image formats like PNG, GIF, and JPEG are raster formats. Vector graphics store images as mathematical lines and curves, allowing images to be infinitely re-scalable at the cost of taking a lot more precision and space to actually specify. SVGs in this case are a vector graphics foramt that specifies its details with XML, and if you open one up you can actually read all the different lines and shapes being defined in the SVG with your standard text editor.

I use a vector graphics program called Inkscape to edit SVGs and create some of the icons on the site. I've never really been able to understand Photoshop or GIMP, and Inkscape editing makes intuitive sense to me in a way that raster editors do not. I actually designed a t-shirt with it that ended up getting printed for the math club I was in for college, and I've loved the program ever since then. I'm technically working on a visual overhaul of the site in Inkscape, but that isn't done yet (as of the time of writing, all the backgrounds are basic colors, and I want to make something a bit fancier).

Anyways, all of this is a roundabout way of saying "I actually know a little bit about how SVGs work". I hadn't done SVG animations before, but I did know how to edit SVG's with Inkscape, so I suggested the program to them. They downloaded it and I showed them how to make some basic rectangles and shapes with it, as they had never used a program like this before. They began drawing the letter K to spell out their name, but ran into a problem where since they were making the K out of rectangles, the lower-right slanted downwards rectangle didn't have a flat bottom compared to the back of the K. I showed them "Object to Path" and how to adjust the vertices of the rectangle to make it more like a trapezoid, where the bottoms aligned.

Now, in my opinion, this K was not that exciting to me. There were a bunch of misalignments, not all the parts weren't the same size, and it wasn't symmetric. It did not meet my standards of a good-looking K. But the excitement that they felt when they finally put this single K into their website really blew me away. They were so excited that they made a thing and that it was working that they didn't care about my unspoken expectations for what looks good. They immediately raced to make the other letters of their name and embed them into the website, each new letter coming with the same excitement as the first letter. By the time I had to leave, they had done their entire first name in Inkscape and proudly displayed it on their website.

Now that I think about it, this example has nothing to do with coding. Why did I do this? Whatever, it's still important. The point of all this is that I hadn't realized how much I took for granted the ability to make your own things. For me, crafting a simple icon that I liked was no big deal, and I had a ton of standards for making something that "looked good". For K, the simple act of creating their own SVG means unlocking a whole new world of possibilities. It pulls the realm of the unknowable and impossible into the possible, and having that control is unsurprisingly really fucking exciting! It doesn't matter how "bad" it is to other people, being able to make your own things and express yourself is a joyous thing that everyone should have access to.

final words

To try to relate this back to EndVertex's video I mentioned at the beginning, being able to code means not having to put up with predatory software practices. When there's a niche program you want that isn't already out there, you make your own. When a program doesn't work the way you want it to, you change it. And when companies change the terms of the deal on people, you code an open-source alternative. Coding means not having to accept the terms you've been given, and instead writing your own.

I think freedom is an inherent part of computing and computers. By its very nature, digital information can be replicated and rewritten freely, but companies have to bend over backwards to restrict this freedom in order to make money on their products. Because everything needs to make money, we see projects from major companies ending up rushed and underbaked, lacking any sense of soul or creativity, jam packed with every dark pattern and abusive practice to extract as much money as they can. But no amount of money can escape the fact that computers are free by nature, and anything can be replicated with enough time and effort.

One day, I'm going to be the person that coded a huge workaround to a popular program, and that day is going to be great. I want everyone to be able to do that, and not be forced to accept the terms of terrible companies with terrible products. I can't promise that you or I will be able to reach the heights I dream of, but I can say that creation can be a joyous thing, and one way to do that is through coding. Even starting at the floor of what you can do with coding, you can have a blast, I sure as hell am with this website.

I really don't know how to end this post. Go try your hand at coding? Maybe reverse engineering? Maybe don't? I just wanted to talk about what coding means to me, and now you know. What you do with that information is up to you. Go out there and have fun.