Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
This is what it's like to be a programmer
This is what it's like to be a programmer
#1
Here's a little story about what life is like as a programmer, without getting into anything too technical.  For those of you who understand the idiom: this is a story of yak shaving.

So, I have a little program that helps me to organize various images I find online.  Because it's a little program, I run it on a little computer/server, a Raspberry Pi. One of the things that I've noticed lately is that new kinds of image formats are popping up now, specifically AVIF and WEBP.  They're a lot smaller for the same image quality.  And because I make downscaled thumbnails of the images, if I want to support them in my program, I need to have an image library that can read the things.

I look online and see, oh great, the current version of Image Magick supports these formats.  So all I need to do is compile a new version of the library.  Except that it didn't work, and now it actually didn't even want to show JPEGs either.  So the obvious thing is that I'm missing "optional" libraries that make the thing actually work.

So I start googling around.  What are the libraries?  What are they?  Eventually I find that Image Magick calls them delegates for some reason, whatever, and I find a XML list of delegates on their website.  That list doesn't include AVIF or WEBP.  I just start installing random image libraries like libjpeg-turbo, libwebp.  Those work, hurray!

But what about AVIF?  Well, my googling did find that the GD graphics library uses libavif or libheif to support AVIF.  So let's try libheif (which incidentally also supports HEIC).  And... nada.  This is not working.

So now I'm desperate enough to start reading the code for Image Magick.  After about, oh 15-20 minutes of poking around, I find this line:

  PKG_CHECK_MODULES([HEIF],[libheif >= 1.4.0],[have_heic=yes],[have_heic=no])

And my version, freshly installed, is 1.3.2.  So I need a newer library, and the built-in software installer (apt) isn't giving it to me.

The problem is pretty obvious to me: I'm getting older versions of software, because I'm one version behind on my Raspberry Pi flavor of Debian.  All I need to do is upgrade to the new version.  How do I do that again?  It's not like a consumer computer that nags you to install Windows 11 if you want to be cool.  So more googling, and I quickly find out that you need to edit a random system file to change the sources.  Literally, you're editing two lines of a text file and replacing "buster" with "bullseye", because that's obvious I guess?

The site also recommends making a backup before doing it.  This is, as we find out later, a Good Thing.  Anyway, I'm like "sure, let's backup!"  I grab the little SD card out of the Raspberry Pi -- this is where the small little box keeps its data.  All I need is something to read memory cards in another computer, now.  It's way too small for the slot in the laptop -- maybe I have an adapter around?

I start moving stuff around until I finally found the memory card adapter.  And it is comically the wrong size.  Did I say memory card adapter?  I meant I found a memory *stick* adapter.  The digital camera I bought is ancient now.  So I need one of those adapter thingies for micro SD to SD card, and honestly, I should just buy another memory card so I have more space anyway.  I spend about 20 minutes researching what the numbers on the outside of the memory cards actually mean so I can get a good one for the use case.  Ordering only takes a couple minutes on Amazon, and should be here in the morning.

But I start looking around for how to actually back it up.  There are command line ways to make backups (dd is kinda scary), but someone made a really nice looking software that makes it easy to load on the SD card, so I want to use that.  The website helpfully tells me that my operating system on the Mac is too old to run the software, too.  You may be starting to see a pattern with me.  (That pattern is to not mess with things that are working.)

Now, what I need to do next is to back up the Mac before a major version upgrade.  Or, well, 3 major versions, which I really needed to do anyway because of security updates.  Most of my work is inherently backed up, so I'm not good about automatic backups -- if I pushed it to another computer (with git) or put it on the wiki, there's a copy.  So for full backups, I like having a backup that's offline most of the time, because no ransomware is going to delete a hard drive that's not plugged in.

So I plug in... which drive is it again?  I start rummaging through drawers, and dig up five different external hard drives before I find the one that's doing backups.  (Yes, I am a bad sysadmin.)  Finally, I plug it in; backup goes smoothly.  And then I immediately run the software update program.

And then I wait.  And I take the dog for a walk.  Huh, seems stalled.  I make dinner, and eat it.  Bon appetit.  I come back and it's still stalled at exactly the same place.  After two and a half hours, and a bit more googling, I'm done with waiting.  I flip the power off.  The screen goes black.  Power it up again, and it starts up, loads a progress bar that stops in the exact same spot.  Ugh.  What now.

After a moment, the computer restarts itself, the progress bar loads up, and starts progressing itself. In one more minute, I have a login screen.  The moral of the story: to fix electronics, simply turn them off and on again.  But I'm sure glad I had that 2 minute old backup!

After clicking past the setup screens, now it's the old process of making sure what used to work on the old OS works on the new one.  Reinstall dev tools, update developer software with homebrew.  It's not too bad, just time consuming.  Some apps are now broken in the new OS, but such is the cost of progress.

Meanwhile, I now have a pile of cords and hard drives all around the room that need dusted and put away.  Why am I doing this again?  Oh right, images.  The room is a now a total mess because I wanted to resize some newfangled image files.  Hopefully my SD micro card will come tomorrow and everything will work fine... but you never know.

This particular example the craft of programming I hope is pretty accessible because there are a lot of physical objects and things that casual computer users end up doing as well.  And yet I needed to know four different languages to get there and manage two different operating systems.  Most of the time you don't get so many physical objects, it's just figuring out how to get software to talk to other software and users.  So yeah, it's a fun hobby!
"Kitto daijoubu da yo." - Sakura Kinomoto
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)