C++ Day
This is the story of the most important day of my life. Let it be an inspiration, and show that sometimes one solid push is all you need to get you on your way to something new.
Background
I had been playing a lot of Exapunks, and I realized that I both enjoyed programming, and was relatively good at it. Since I already worked at a software company as a technical writer, the opportunity was there to become a dev. But if I wanted to change jobs I would have to learn our primary language, and that language was C++. I’d also never written any code outside of Unity or Gamemaker before, so compiling, linking, program architecture, and all that other stuff was totally foreign to me.
Early one morning…
I had time to kill; my then-girlfriend-now-wife was out of town for the weekend, and I had no particular plans. There was also an application I had been thinking about for a while, a networked application between my Windows PC and SGI Indy (which would come to be called CursorMagic).
When I sat down with my coffee at 8 AM Saturday morning, I could have sat on my butt playing video games. But somehow, the motivation planets aligned, and instead I launched Visual Studio and started trying to figure out how to yeet data over the network. One of my friends at work had already pointed me towards Berkley sockets , and some incredibly helpful person put near-complete working examples on Wikipedia.
Intense focus
Starting from an empty project and almost no experience writing C++, here are a few of the things I had to do on that day:
-
Set up a build system on IRIX.
-
Open a window.
-
Get the frame-grabber input to show in the window.
-
Capture Windows mouse events.
-
Open a socket and send UDP packets on Windows.
-
Open a socket and receive UDP packets on IRIX.
-
Design a data structure for holding mouse event info, pack it on Windows and unpack it in IRIX using casts.
-
Learn that the Xtest library exists and figure out how to link it in and use it to move the cursor.
Nowadays, I look at that and think "Hmm, that’s a good day at the office". At the time this was grueling and often frustrating, since the number of things you need to get right in order to get anything working is pretty substantial.
Fortunately I made some good decisions as far as breaking it into smaller pieces,
like sending packets to an existing app on my phone
to confirm the sending side was working.
Unfortunately I didn’t know to optimized my #includes
,
so any change to a header would cause the whole program to recompile.
Barely perceptible on my Ryzen 1700x,
but that took around 3 minutes on the 150MHz Indy.
Rather infuriating when you are just learning the language.
Fast computers are nice.
At the end
It was very nearly midnight.
The performance was terrible.
The mouse would move across the Indy’s desktop inconsistently, and at best with a single-digit framerate.
But it worked.
That’s how I learned C++.
That’s how I became a professional dev.
That was the most important day of my life.
(Or maybe the day I met my wife, I dunno it’s in the running).