Source: My arsenal of Home Depot supplies used to wage war against certain truck deficiencies.

It's been long enough.

I took my sweet time getting around to actually doing it, and then almost another month on top of that to start writing this post about it, but we're here now.* And that's what really matters, right?

So anyway, you might remember "The Hole" from that time that birds always insisted on pecking at it, or that other time that I MacGyver'd a drainage solution to avoid waking up in a truck-shaped rainwater swimming pool. Looking back, I had every intention of paying another human being money to fix this particular problem. That all changed once I received an email from Nancy (over at PK Safety), who, like BoscoBob before her, knows way more about fixing my problems than I do.

Nancy was kind enough to give me step-by-step directions on how to apply a sturdy smattering of fiberglass mat/resin to the tragically maligned hole, directions she curated and perfected from her experience fixing/consistently-being-in-close-proximity-to boats. "If this treatment is good enough for boats, which have to withstand waves and constant interaction with salt water," I thought to myself in a conveniently blog post-ready format, "it's sure as hell good enough for protecting my truck from a few gentle raindrops."

The Plan

As you can see from the picture above, this wasn't a small undertaking. Quite the opposite, this was hands down the largest truck improvement project I've attempted thus far. And as a person who's never considered themselves "handy", "useful with tools", "remotely adroit at anything that requires common sense", or "likely to survive attempted usage of industrial chemicals", this was sure to be a demanding (and educational) experience. With Nancy's instructions in hand, I biked off to, you guessed it, Home Depot, a company so integral to my truckly lifestyle that I should probably double down and buy stock in it. On my short list of things to buy:

  • Acetone. As it turns out, acetone is useful for more than just pyromaniac teenagers (guilty) and removing nail polish. It does a solid job of cleaning/preparing surfaces before putting other chemicals on them. It was especially useful for my needs because there were clearly failed attempts by previous owners to fix The Hole, as was evident from the strange rubbery white residue surrounding it, which I'm guessing is Flex Seal.
  • Face masks. Preferably get the type that save you from losing a couple IQ points to the chemical cocktail you're about to whip up.
  • Drop Cloth. Because I've never been particularly capable of coloring inside the lines, and I don't have a burning desire to cover my walls and floor in a nearly-impossible-to-remove epoxy.
  • Great Stuff® - Window & Door Sealant. To completely misuse and make the walls look like they're giving birth to some cross between Alien and the Stay Puft dude. Check out the picture below to see just how I thoroughly I screwed up. Note: It is literally called Great Stuff®, my opinion isn't quite as enthusiastic.
  • Fiberglass resin. To go with the Fiberglass hardener.
  • Fiberglass hardener. To go with the Fiberglass resin.
  • Fiberglass cloth. If the resin and hardener are the marshmallows and chocolate in a bad food analogy, the cloth is the graham crackers that hold the whole sticky metaphoric S'more situation together.
  • Painter's tape. I think the intended purpose is to mark off the area you're working on, but I completely skipped that step.
  • Empty, clean Chobani® Greek yogurt cups. For mixing epoxy. I used the low fat plain-flavored variety, but I've heard that strawberry works well too.
  • Paint brushes. For gooping up and dabbing the epoxy onto the fiberglass cloth.
  • Several types of gloves. Because while super-gluing your fingers together is undoubtedly unpleasant, I imagine epoxying your fingers together is at least two circles of Hell deeper.
  • Water. Stay hydrated out there, kids.

Nancy's list of Hole-fixing ingredients also included things like "sand paper" and "primer" and "rollers", which I dutifully ignored because it looked like their collective purpose was to make everything look prim and proper, which isn't of any particular interest to the dude who lives in a borderline leprotic van still covered in several-year-old graffiti.

Getting It Done

I had everything I needed to do this thing, I just had to put the rubber to the (literal?) road. I woke up early on a beautiful and crisp Saturday morning, drove to a nice remote area, and threw open the back gate, both for ventilation and sunlight.

The view from my work site.

The first step was to survey the area and plan out how I was going to handle it. There was a chunk of fiberglass missing on the right edge, and there were a bunch of cracks that extended about a foot beyond that. I had bought more than enough to do the whole area over, so I put some acetone on a paper towel and cleaned down everything extending a few inches beyond the cracks. The idea is that the acetone removes anything that would prevent a good bond from forming.

Yup, definitely a hole.

One last piece of setup: I tossed the disposable drop cloth out below the soon-to-be affected area, and taped it to the wall with the painter's tape. Before whipping out the rest of my meth lab essentials, I threw on a pair of gloves and one of the face masks.

Casting sideward glances to intimidate and confuse The Hole is also a recommended, but optional, step. *insert a good Bane impression here*

Anything more than very basic instructions leave me befuddled and deterred, so I was grateful that the fiberglass resin and hardener had simple ratios to mix together: a certain number of drops of hardener per cup of resin. The trick is that you only have 10-15 minutes of time to spread the mixture once you mix them, then they harden up and become a sad unusable cement. That's why I had been binging on Chobanis®, I needed multiple cups for multiple small batches. So I poured a small quantity of the molasses-like resin into my plastic measuring cup, and then counted out the corresponding number of hardener drops into one of my re-purposed yogurt cups. After pouring the two components into the same container, I frantically looked around for the stirring sticks I had completely forgotten to purchase. Luckily, the wood chips on the ground just outside the truck made for great improvised stirring sticks. From there, it was just a matter of painting a thin layer of epoxy, ripping a piece of fiberglass cloth off, dabbing it all down with a little more epoxy, and then repeating the whole process again, layer after layer. I put down around 20 pieces of the fiberglass cloth in total over the course of my three batches of epoxy, with each piece roughly half the size of a sheet of paper.

The end result (before drying). It doesn't actually look any better in this picture, but I can assure you that it's all one solid piece now.

To finish up, I threw all the leftover, unsalvageable, half-used ingredients onto the drop cloth, which I then rolled into a little ball and tossed into a giant garbage container belonging to a nearby construction site. I then left the truck-patch to cure (and vent some of the brain-cell-killing chemicals away) for the rest of the day, opting to go on a nice long bike ride and coding from a cafe a few towns over.

Is It Holding Up?

If you go back and look at my first two Home Improvement projects, you'll see that I did a terrifically shoddy job on them and had to immediately turn around and repair them. Luckily, that doesn't seem to be the case this time around. Nancy's instructions worked wonderfully, and the bond still appears sturdy as ever. One pretty big issue is that I didn't totally fix my leaking problem. I still have a pretty consistent drip from the metal area to the top right of where The Hole was, and I have to do a bit more research as to where it's coming from before El NiƱo turns my truck terrarium into an aquatic abode.

The Great "Great Stuff®" Unprovement Project

The idea behind Great Stuff® is pretty simple. You shake the can, you spray it into the cracks, it expands a bit, and it provides a little extra insulation. I thought this would be a great addition to the area around The (now defunct) Hole, and just the back of the truck in general, which is a bit drafty. But I forgot to take into account how bad my basic motor skills are, and how much the stuff expands, and I kind of just coated seemingly random bits of the truck in it. It legitimately looks like Shrek had a vicious cold and was sneezing huge mucus-y webs of lumpy sadness everywhere.

A collage of my ceaseless stupidity.

The icing on the cake is that the only way to remove the stuff, per the instructions, is "mechanically". Meaning I have to physically rip this stuff free from everything that I've attached it to if I want to redo it properly, which I'd like to do at some point. Like I said before, if nothing else, this project was very, very educational. And while I don't know when any of this information will ever come in handy again, it's certainly helping me towards (wrongly?) believing I can undertake larger and more ambitious projects in the future and maybe have them not fail entirely/spectacularly. I guess we'll see.

*I was really waiting until I had finished adding the functionality to put multiple pictures in a post, which as you can tell, totally exists now.


Desiccant.

I really enjoy the way that word sounds. It's like a discount version of decadent, except that it hasn't been soiled by rampant overuse in chocolate commercials. I was curious as to its etymology which, as you'll see above, isn't nearly as exciting as I'd hoped. I had never even heard of the word until a reader, known only to me as "BoscoBob", brought it up in an email.

Bob

Let me tell you a little bit about Bob (which he will henceforth be called for brevity), not that I know much about him anyway. Bob also spent quite a bit of time living in a vehicle, five times as much as I have as of this writing in fact. In my eyes, this makes Bob a Wise Truck Elder™. So when Bob came to me with advice, I took notes. Diligent notes.* His advice was this: it's going to get cold out, and human beings do a lot of breathing and sweating. If you can't control that moisture, every eligible surface in the truck will be covered in mold, which is undoubtedly going to make you an unhappy camper.

Luckily for me, as Bob noted, there exists a magical technology that requires neither fire nor electricity to operate, and yet its mere presence can suck the moisture clear out of the air and trap it within, like a genie in a lamp. Bob was talking about desiccants.

The Prophecy

And sure enough, Wise Truck Elder Bob was right. As we creep further and further into Fall, unwaveringly towards Winter, I've found that my mornings are becoming increasingly…moist. Every non-porous surface: ceilings, walls, and even my phone** and battery pack, are uniformly damp, almost like the morning dew on a grassy field. Except this field is me and everything I own. It's gross to think of it as though everything is coated in my own sweat and breath though, it's more like when your windshield fogs up on a cold day. The air in the truck is warmer (because of me) and more moist (yes, also because of me), and this warm, moist air meets up with the cold metal of the truck and subsequently condenses. I mean I'm not a meteorologist or anything, but that's my understanding of it.

So I did what any self-respecting truck person who doesn't like bathing in their own breath would do, and I went to Home Depot, where they sell industrial-sized tubs of this stuff:

DampRid®, which I can only assume is concentrated cat litter

I got a 64 oz tub, which is supposed to be enough for a space far larger than my 128 ft2 truck, but I like to live by the credo "Better Safe Than Sorry" when it's convenient to me. The process for getting it setup was pretty complicated though, and took longer than I'd have liked. I'll painstakingly detail the steps out here, but be warned, it's a pretty arduous process and I wouldn't recommend someone begins it unless they have a substantial amount of time on their hands to see it through:

  1. Take off the lid.

Yeah okay I lied, that's all you have to do. Seems suspiciously simple, I know, but it definitely did fulfill its end of the bargain. The area around my bed was much drier the morning after opening it; my phone and battery pack weren't in any danger of short-circuiting either. The tub of re-branded cat litter DampRid® says it'll last six months, which isn't bad at all for a $10 investment. I suspect it'll have a shorter shelf life because the truck isn't an entirely closed system, but I'll need a bit of empirical evidence before I can say for sure. In the mean time, I'll enjoy being left high and dry thanks to the definitely excellent existence of the desiccant.

*I didn't actually take any notes. This was an email, after all.

**My phone is waterproof, so this isn't as concerning as one would thing. Still definitely not ideal though, thus the desiccants.


Source: Snipped straps and super glue, combined with a little (accidentally) dramatic and gloomy lighting

It's been a while (six months almost to the day) since I did my last big Home Improvement post, and I think it's about high time we changed that. Not only because a lack of Home Improvement posts signals stagnancy on the front of truck-progress, but also because there is much to be improved upon truck-wise, and I should be more proactive and motivated to work on it. This, as is likely evident from the title, is just a "Mini" Home Improvement project, but there are two fairly large ones that I've yet to write about, so expect those soon eventually.

Meeting Michael…'s

In a shocking turn of events, a home improvement project didn't land me at Home Depot. Instead, I found myself ambling around the aisles of Michael's, a fairly ubiquitous craft chain store. I'd place Michael's pretty far down on the list of places I'd expect to find myself at, right there with "an apartment showcase", "grad school", and "a Homeowner's Association meeting". And yet there I was, shopping for leather wristbands and Super Glue like a pre-K camp counselor.

This strange shift in shopping proclivities came about as I attempted to solve a problem that has been plaguing me since before I moved in. I detailed it at the end of this post, but as a refresher, my problem was thus: I have a house on wheels that I drive sometimes, how do I properly secure dresser drawers so I'm not launching them (and pretty much everything I own) across the truck every time I take a turn too hard? My initial solution, Velcro, had failed spectacularly (and very audibly from the driver's compartment). As a stopgap solution so that I could, you know, drive, I wrapped the corners of the drawers in painter's tape, the only reasonable adhesive I had available. Naturally, this had a few problems of its own, like how it's annoying to un-peel and re-peel tape every time I want to grab a pair of socks, or how the heat during the day means that the tape loses adhesion pretty quickly and I have to reapply it, etc, etc. I got a few suggestions from strangers on the Internet readers on using childproof drawer locks and a few other ideas, but they didn't seem quite robust enough for my use case.

Leather and Bondageing Glue

Eventually (read: two weeks ago), I had a bout of divine inspiration during which I realized that some combination of buttons and snaps would suit this situation well. The aforementioned trip to Michael's happened, and then I applied the following process to save my dresser drawers from my dubious driving abilities:

  1. Remove the ineffective Velcro squares from the drawers by wedging your fingernail under them and peeling them off. Make sure to break or otherwise bend at least three fingernails in the process.
  2. Cut the male end off of the leather straps into little squares.
  3. Cut the female end of the strap to 3 (ish) inches.
  4. Measure the vertical midpoint of the drawers and mark them with a pen.
  5. Measure out where the longer straps should be glued down and mark those with a pen too.
  6. Glue those little square suckers down to the rolling-drawer-handle-part with some super glue.
  7. DO NOT GLUE YOUR FINGERS TOGETHER.
  8. DON'T GLUE YOUR FINGERS TO THE LEATHER EITHER.
  9. You glued your fingers together, didn't you?
  10. Use the acetone you bought for a different home improvement project to unstick your thoroughly bonded fingers.
  11. Apply glue to the last inch and a half of the longer straps, leaving room so that the snappy end can move around a little bit.
  12. Definitely don't immediately test it out, wait like 8 hours (at least) for the glue to fully cure.

Boom. Successful strappage.

How well does it work?

It works really well…when I remember to snap them shut. On more than one (read: three) occasions, I totally forgot to snap them into place before driving off, which, as it turns out, makes them Totally Ineffective™. But when I do remember to use them, they work swimmingly. Super glue fares especially well when the force is parallel to the surface, I just have to be careful to not tear the leather straps off like a Band-Aid® when I unsnap them. Overall, it took about hour to do all the measuring/cutting/gluing, which isn't bad in the slightest, especially when it means driving around is less like throwing my belongings in a tumble dryer.


Source: The creepy face-blur makes its return for the truck-people meetup at Containertopia.

TrainspottingDefinitely not the word I'm looking for, but it sounds cool

I noted early on that I wasn't the only sketchy-looking vehicle on campus. And the longer I've been doing this, the keener my eye has gotten to the subtle, but telltale signs of "unconventional" or otherwise "alternative" living situations: windows tinted a little too deeply, parking just slightly farther away from a building than everyone else, a few scattered blankets on the back seat. It was nothing more than conjecture and supposition until I made contact with another truck-person. Even then though, there were seven or eight cars I was seeing all the time, and they certainly kept me wondering.

Beyond campus, I was seeing the same signs everywhere: lines of RVs in loosely-regulated parking areas, disconnected trailers in run-down driveways, condensation on car windows long after it should have burned off, etc. I couldn't tell if they were as common as I perceived, or if my situation had made me unusually sensitive to it. It reminded me of a story recounted by a high school teacher, whereby he fell in love with a girl who drove a green VW bug, and thereafter started seeing those cars everywhere. He called it the "Green Punch Buggy Effect™," though it's likely more commonly called the Baader-Meinhof Phenomenon.

Joining the Cult

At first it was merely a hunch, yes, but once I started shouting my automobile affinities from the rooftops, it wasn't long before truck tenants, clunker colonists, sedan citizens, buggy boarders, hatchback inhabitants, and pickup people of all types started to come out of the proverbial woodwork. I quickly found myself in the CC field of an email thread with the title ATTN: Vehicle Dwellers Meetup, along with no less than fifteen other like-minded individuals. Most of the thread participants were doing some tech- or startup-related work, though I was impressed with just how diverse the group was, and how sane and reasonable everyone seemed. At this point, I really shouldn't be surprised that reasonable people are coming to this dwelling decision, assuming they're going to be crazy is more of a vestigial knee-jerk reaction on my part from before I dove headfirst into all of this (see here for my initial, incorrect preconceptions). With the voluntarily homeless corralled into a digital conclave, we started planning where we could talk about the various intricacies of our day-to-day lives (much like I do here) and show off our setups. Fittingly enough, it was decided that this shindig would take place at Containertopia, a secret and magical place in Oakland filled with shipping containers in various stages of being converted into homes.

Meeting My Contemporaries

The meetup took place on a crisp, sunny Saturday afternoon a few weeks ago, and as such I opted to bike to the Oakland meeting place.

Woah woah woah, Brandon, why would you bike up there when the whole point of going was to show off your truck house thing?

Well there's a few reasons actually. Firstly, I'm not under the illusion that my "setup" is anything more than a bed and a dresser shoved into the back of a decrepit moving van, which I (correctly) assumed would be downright embarrassing in the face of the craftier solutions of others. Plus, I've mentioned that driving the truck is a death sentence, so I opted to showcase the entirety of my lavish, expansive living space by taking a few photos instead of spontaneously combusting on the 880 during an attempted drive. Summarily, the signs seemed to say, or otherwise suggest, that cycling was surely sensical. In a textbook display of character weakness, I dramatically overestimated my own ability to do sustained cardio and ended up arriving at the agreed upon meeting place an hour or so later than planned. A few calls and texts later, I was led through a wrought iron gate and into what can only appropriately be described as a Mecca for tiny houses of all shapes and sizes.

The idea behind Containertopia is a fairly simple one: You buy a shipping container for between $1,000-$2,000 and have it delivered to the place, which is basically a large open warehouse with communal facilities (electricity, water, etc). From there, you pay a (comparatively reasonable) rent, usually temporarily as you hammer, nail, weld, rip apart, and otherwise modify your shipping container to your specifications and desires with the intention of doing something with it.

The place itself felt like a post-apocalyptic construction site…but I mean that in the most endearing of ways. There was always the distant whirring of heavy machinery as people worked on realizing their dreams, and the cold concrete floors were littered with all imaginable components and contraptions. We were given tours of a few of the containers, which ranged from barren to decked out with windows, carpeting, insulation, and all of the modern amenities you'd expect from a high-class shipping container house. As for the more mobile participants, their housing solutions ranged from standard RVs all the way down to Priuses (Prii?) outfitted with magnetically-secured insulation. We hung around for a few hours talking about the various trends in tiny housing, living in the Bay Area, and our own ideas, inspirations, and future aspirations, then we grabbed a lovely dinner and parted ways.

All in all, the experience was enlightening. Aside from the fact that I'd never before biked anything even remotely close to 50 miles, it's always interesting to talk with other people from a bunch of backgrounds who've all converged on similar solutions, executed in dramatically different ways. And between this new group of non-stationary settlers, and another group of tech-truckers I've become acquainted with at my own place of employment, I have a new-found network of truck friends, which is something I never thought I'd find myself saying.


Source: My App Engine console, with a few minor tweaks

What CMS are you using?

What WordPress plugin do I use to make a clock like yours?

You're using AppEngine right? I can tell by your blog's IP address.

Brandon, when are you going to nerd out and talk about technical stuff?

Right now, as it turns out. First, a little disclaimer:

This post is more for the technical types. You'll likely find this post mind-numbingly boring if you don't have an interest in programming or web development.

Still reading? Sweet. While I can't talk about what I work on in my day to day professional life, I can talk about my background and blog-related things, which in my opinion are more interesting. If you want juicy technical details, skip the "Background" section, that's just me reminiscing over a time in my life where I didn't have to come to grips with being an adult and stuff.

Background

On the sidebar, I mention that I'm a "Software Engineer". I capitalize Software and Engineer because it's my Official Title™ and it makes me feel Very Important™. I didn't always hold this position though, so let's start at the beginning.

For some reason unbeknownst to my current-self, a smaller, younger version of me had it in his silly little head that he wanted to be a lawyer. Maybe it was the allure of bucket-loads of bucks and the promise of putting particularly unpleasant people in prison, I can't say for sure. In any case, I shot down that dream while filling out a health form (or something similar) and realizing that I hated paperwork. Considering being a lawyer is like 99% paperwork (with the other 1% being bureaucracy and more paperwork), I opted for a far less miserable dream.

My first formal introduction to programming was at nerd camp when I was 13. I learned the fundamentals of C, building a basic command-line choose-your-own-adventure game. That was cool and all, but it was actually one of the other classes that caught my attention. A different course was using Multimedia Fusion, a programming platform with an easy click-and-drag UI. When you're 13 years old and you just made your first text-based game, that feels pretty sweet. When you look over and the kid next to you has made a full-on graphical game complete with sprites and sounds, you know it's time to step up your game.

So after camp was all over and done with, I started experimenting with this Multimedia Fusion software. I eventually got good enough with it to actually work with Clickteam, the company producing the software, and I built some educational children's games to showcase their tools. Multimedia Fusion was really a gateway programming language though, and it wasn't long before I started looking elsewhere to get my fix.

I spent five summers in my hometown as a parking lot attendant, and as the beach/lot became more popular over the years, people started asking for a way to make parking reservations online. Being the enterprising 17 year-old that I like to think I was, I whipped up a web app in PHP (for no other reason than I didn't know any better), and an accompanying Android app. This PHP app was hands-down the worst thing I'd ever written in my life. Not only did it have zero testing/version control/productionization/comments/coherence/style of any kind, the codebase was essentially a Franken-program of half-working snippets from Stack Overflow duct-taped to a MySQL instance hosted on a now-defunct web host, with all the worst CSS attributes in existence plastered onto the frontend. Somehow it worked though, and every day I'd use the Android app to keep a live-updating count of how many cars were in the lot, and people would pay me a dollar a piece to reserve a spot.

In college, I did a little bit of everything. I drove buses, programmed bus websites, graded for classes, and picked up contracts for any project I could get my hands on. Along the way I dabbled in Ruby/Rails, Python, Node.js, some Android stuff, a ragtag collection of web frameworks/technologies, and even a bit of assembly. I eventually stumbled upon Golang, and that's what most of the code I write of my own volition ends up being in, including this blog.

The Blog

At a high-level: this blog is written in Golang and hosted on Google App Engine. Posts and questions are stored in Datastore, and images are stored in Blobstore. The frontend is your standard HTML/CSS/Javascript stack with a sprinkling of Bootstrap because, let's be honest, nobody actually enjoys frontend web dev. I don't use Markdown or any other markup languages; posts are written in plain ole HTML, with the odd CSS class added to my stylesheet for new functionality.

Golang

If you haven't heard of Golang before, allow me to make the introduction. It's a fairly simple language, looks like a bastard child of C and Pascal, and puts primitives for concurrency right into the language. It's compiled and garbage-collected, which means deployments come in the form of single solitary binaries, and memory leaks are less likely to exist/ruin your day. If you're familiar with C or Java, you can probably learn the language in an afternoon. Built right into the standard library is a world-class HTTP package, as well as a templating system, and there's an extensive network of tooling covering everything from linting and formatting to deadlock detection and code coverage.

App Engine

App Engine is the magical piece of technology I use to host my code. It's kind of like Heroku, if Heroku didn't hold your hand quite so tightly and was built on big-boy infrastructure. It provides a great local development environment for me to iterate on, and deployments take <30 seconds. The built-in logging, monitoring, profiling, load-balancing, versioning, and auto-scaling, among a dozen other features, mean that I can focus on the blog and not unrelated productionization details.

Savings Clock

The code for the savings clock can be found at the bottom of this Javascript file. It's basically just a function that runs once a second and calculates my savings given some hard-coded values and the current date/time. Since my insurance rate is variable (as is the cost of rent), I divide the time between May and whenever into "epochs", each of which has a start and an end date, and the insurance and rent prices for those respective time periods. Then I iterate over the epochs, noting whether or not we're in the middle of one, and sum up the savings over all of them. Before updating the display on the page, I check if the value is negative (which it isn't anymore!) and format it appropriately.

Optimizations

I threw the blog together over the course of a few days in May, back when I was still unsure whether or not I could actually live out of a truck. Being the hectic time that it was, my main concern wasn't code quality or adequate testing coverage, but rather getting my thoughts onto the proverbial paper while they were still fresh in my mushy, unreliable mind. This was fine for a while, but I couldn't help but notice that each new feature took longer to integrate, and was more frequently broken than not. I knew it was time for an overhaul.

The Refactoring

The scenario is familiar to anyone who's ever done a bad job at maintaining a codebase: editing existing code becomes painful, and adding new features becomes brittle and burdensome, normally involving lots of copy and pasting and manual testing. In my case in particular, there was little to no isolation between components, and I was passing around global objects like it was nobody's business. So I started a new branch (because I use git and Github like a reasonable human being), and set to work. The first big change I made was wrapping App Engine's Context with my own and passing that into all my request handlers. Then I added interfaces for database lookups to decouple the implementation details from the business logic. Wrapping the default templating system with my own helped to get rid of the code duplication surrounding rendering common components, and a bunch of other small code clean up tasks around the site reduced complexity and fragility. Abstracting things like pagination and post creation out into their own independent ideas further slimmed the handler methods. Since everything is easier to test with proper abstraction, I tossed in a few more unit tests for basic functionality, and finished up by running the golint and go vet tools and implementing the suggestions they provided. A few weeks and a few thousand lines of code later, we're here, with a much more maintainable web app. To celebrate, I started adding a few new features.

Caching

When this blog was only getting 10 hits a day, it didn't matter how inefficiently I served up my content. After all, Datastore read/write requests are charged by the millions. I could have ran the website on a Raspberry Pi and nobody would have been any the wiser. But my fleeting collision with the limelight meant that suddenly those redundant calls started to add up. It wasn't until recently I realized something that should have been abundantly obvious from the outset: I'm the only one who updates the content on the site, I don't need to check the database to see if it's been updated. I can store pretty much everything in memory and serve from there, refreshing the in-memory representations anytime I create or edit a post.

Uh Brandon, you know that there's Memcached for that sort of thing, right? In fact, it's even integrated into App Engine.

I…I actually didn't know that. And if I had known that earlier, I probably would have done that. But since I had just finished my refactoring, it was a snap to add in a caching interface, and then drop the business logic into my new Context before it delegated calls to the Datastore.

Parallelism

A couple days ago, I stumbled upon the Cloud Trace feature of App Engine. So I turned it on, loaded the main page, and saw the following:

Well that's no good.

Can you spot the cardinal sin? I'm using a highly-concurrent programming language, and yet I'm loading all of my image URLs for a given page synchronously. There are five requests, because I put five posts per page and each one has a single title image. So I made a new type to represent a list of posts, and then added a prefetch function that would spin up a separate goroutine for each post, and wait until all of them had finished, using a WaitGroup. As you can imagine, it's approximately five times faster now, as shown below.

Much better.

But it turns out I had an even worse offender, the search functionality (which actually works now). A search for a common word, like "the" or "truck" or "deranged" (kidding) would load the entire corpus of posts, and all of their images serially, as shown below.

It's hard to see, but this request took nearly 3 seconds!

But running our handy-dandy new parallel prefetcher on this made quick work of that.

Down to 700ms.

Naturally, I'm still at the mercy of the longest-running lookup, plus building up the inverted index, which takes nearly 500 ms (and will grow linearly with the number of posts I write), but it's definitely an improvement.

New Features?

Now that I have a lean, reasonably sane codebase, what's next? I have a few ideas.

Post Comments

People have their own ideas about my ideas, and sometimes they'd like to share them in a forum visible to the rest of the Internet-connected planet. I'll definitely add these at some point, once I build up sufficient tooling and reasonable spam blocking.

Microposts

All of my posts are about the various mundane aspects of my life: whether it's leaky roofs, insurance, bicycles, or the weather, if the topic is boring and has no right being expounded about for paragraphs on end, there's a good change I'll write about it. But some of the prosaic things I want to talk about don't always warrant a whole essay, just a little blurb. What I'm describing is basically Twitter, but as an engineer with no interest in actually using Twitter, it seems reasonable to just whip up my own little system.

E-mail Subscription

For people who aren't a fan of RSS, but still want to read about my apathetic adventures.

Interactive Questions/Comments

Right now I have a comments/questions section, but it's one-way, so if people have a burning question and don't want to e-mail me or wait for me to do another Q&A, they're currently out of luck. I think it'd be cool if when you ask a question, you could get a link that would act as a private, topical chat and we could reply back and forth on that.

I have a few other features in the pipeline: I'd like to improve my search functionality, and maybe add a post listing by month or topic. I've been adding little features here and there and updating the layout, and if you have any good ideas for new features, I'm all ears.



Subscribe

If you want to get emailed when I write a post, add your email here. Don't worry, you can always unsubscribe.