A few things I learned about programming while building a small web project
Email marketers love a good subject line mishap. You know, when it’s supposed to say something like, “Get 50% off all cocktails from 5–7pm” and it doesn’t quite work out.
Because everyone reads their email on different devices in different apps with different column widths, there’s a great chance at least some recipients will see a truncated version of any sent subject line. Inspired by some of the accidents that get posted in Email Geeks Slack, I made a tool to check would-be subjects for unintended messages.
Here are some things I learned while building it:
- Developers take obscenities very seriously. GitHub hosts loads of repos full of swear words. Some are even organised into different languages. The pull requests have some entertaining titles.
- How to write and use functions that accept arguments. I’ve seen this done everywhere but just never knew how to do it. (Take it easy on me; I’m a designer.) I’m sure I’ve written code where these types of functions would have come in handy but I always got around it — probably by writing bad code. Now I have a really solid understanding of it.
- How to set and read URL parameters. This was my favourite part of the project. Pressing the “Copy link…” button grabs the value from the input, URL encodes it, and appends that to the page’s base URL as a subject parameter. When someone visits the page, I check the URL for a subject parameter and, if I find one, populate the input and trigger a button click. Not the most impressive technical feat but I think it makes for a nice feature.
- More than I knew before about splitting arrays and strings. I’m not sure if this is really that complicated or if I just find it tedious. Either way, it makes a little more sense every time I need to do it.
That last point is actually how I feel about programming in general. With every little project or task, I get faster, it feels easier, and I notice my skills improving. I built only static websites for years and years. Now I have the confidence to at least attempt anything I can think to create.