September, 2020 — I started blogging in 2005. I know! It feels like that was forever ago. In terms of publishing online, it was. There weren’t many options for blogging at the time, and what was available seemed like overkill for all I was wanting to do — write and post some photos.
I’ve used a lot of content management systems over the years and have even written a few of my own. WordPress is what I used most often on personal sites. It’s quick and easy to set up, and guilt-free if no one is watching.
WordPress and I weren’t a great match
I did feel guilty though! It never felt quite right that I was using WordPress. I’m a .NET developer when it comes to backend infrastructure, and I’ve spent a great deal of time evangelizing about the modern web on the frontend. Using WordPress doesn’t fit for me because:
- You need a PHP server, or hacky Windows configurations.
- You have a MySQL database to maintain.
- WordPress is bloated and slow, like running in sand after eating greasy burgers.
Granted, the first two issues may not be concerns everyone shares, and maybe they aren’t flaws with WordPress itself. It’s just that I, as a .NET developer, well, I shouldn’t be out there slumming it in PHP (I’ll leave a discussion of why C# is superior to PHP for another time).
I think the overhead and bloat is a legitimate concern though. I realize that there’s ways to optimize WordPress to get more out of it, but the default mode in WordPress is that one size fits most. That’s great, but, I feel like you shouldn’t have to optimize something just to get it to post glorified text in a speedy way — That’s just not for me.
My biggest complaint, though:
Constant updates, like every time I sign in.
Seriously. I don’t blog often, so every time I sign in there is a security update waiting for me. Every time I use it I have to install something.
It’s not their fault. WordPress became a victim of its own success and subsequently a target for every bot. Still, it’s off-putting. I just want to write and post photos. I don’t want to do maintenance when I go to write. So much for convenience!
Sorry, WordPress. I’m breaking up with you. In fairness, I was a neglectful partner anyway.
GatsbyJS, React, and .NET API is my new thing
Moving forward, I’m using a few newer frameworks.
Blogging is about the reader
You see, when it comes to content management systems, what you get is less about the reader, and more about the writer or publisher and what they need to make their lives easier.
Content persists from a database. There’s code for that. Code grabs content from a bunch of different places in the database. Code determines what content to fetch. Code stitches it together.
That all makes the content manageable for the publisher.
Code then applies a template. There’s a template for every page, every part of the page. Code executes all of that.
That all makes the design manageable for the designer.
The reader is barely considered in a traditional content management system. While she just wants read a blog, she’s getting the full weight of the entire blogging system, and the entire mess of code that is executing on every request.
This user experience sucks.
It doesn’t have to be that way and that’s why I’m moving to GatsbyJS.
Gatsby is a React-based static site generator that precompiles content ahead of time for great performance. Here’s how they put it:
Gatsby loads only critical parts of the page, so your site loads as fast as possible. Once loaded, Gatsby prefetches resources for other pages so that clicking on the site feels incredibly fast.
Since Gatsby is also React you have a full UI/UX “Presentation Layer” ready and waiting for your creative whims.
Blogging isn’t just about the reader
The reader matters and is largely overlooked in old-school content management systems that were made for publishers. Still, a blogging system is not all Presentation Layer. We do actually have to manage the content as well.
Here, WordPress could work. WordPress can act as a much slimmer API without all of the extra bloat added on as user interface. Since Gatsby supports pulling content from WordPress as an API, you could continue using it to manage (but not display) content, and this alleviates most of the pains mentioned earlier (still, constant updates!).
WordPress managed, compiled by Gatsby for display. If that works for you, great. Go about your business. It’s just that WordPress doesn’t work for me, for all of the reasons (.NET developer, and so on) I described above.
Fortunately, GatsbyJS supports any API, including private ones, including .NET.
I choose to manage an ASP.NET Web API as the data source for my content. There’s a lot of reasons why I enjoy writing C#, probably too many to get into here, but suffice it to say that when it comes to bringing data into an application I tend to follow this pattern on the architecture:
- Data Repository
- An API returning JSON (written in C#)
- Presentation Layer
I swap out presentation layers depending on the project, but I’m almost always interacting with an API returning JSON. I prefer to have that API written in C#, in .NET. It could be WordPress. It could be PHP. I prefer C#.
In recent years Microsoft has built an incredible ecosystem with .NET Core that allows me to write in C# (my preferred programming language) virtually anywhere — Windows, Linux, macOS, iOS, Android, web, mobile, everywhere. That infrastructure, along with a React-based modern web interface, fits all the pieces together.
I no longer blog feeling guilty on the stack I’m using.