Skip to main content

Posts

Using a React Context as a Dispatch Replacement

React Contexts are the pretty little bows of the React world.

Here's a really quick example of the kind of messy code you can cleanup by using contexts, without dragging in a larger dependency like Redux or even Flux. Starting backwards with a diff showing lines of code I was able to remove:


All the properties I was able to remove were just pass-through. The Carousel component didn't care about any of them, but it had to pass through these callbacks so the multiple TaskList components inside the carousel could invoke actions. They were removed from the Component class itself, too, since it no longer needed to pass them through.

Where did they all go?


My ActionContext removed all the need for these passthroughs by providing a single simple helper method, action(), that components rendered under it can access.


I really enjoy the pattern of passing a single callback through a context and removing what used to be lots of callback properties. Of course, I could be using a proper di…
Recent posts

Cheqee: Or, How to Write and Publish a Mobile App In a Couple of Hours for Free for Anyone

For the first time in a long time I wanted to write a brand new little app, from scratch, just for fun. I was feeling the Joy of Coding coming back after a long hiatus. So, yay for me? Yay for me. The idea for a single-case app for the kinds of repeating chores of the day has been knocking around in my head, so I whipped out npx create-react-app and tinkered on my laptop while watching TV.

In about an hour and a half I made Cheqee, the Simple app for the things you do every day.


I was thrilled to be reminded of how quickly an entirely new application can be built from scratch and published as a PWA (Progressive Web App) and "installed" on any phone and used like any app by anyone around the world, so here's the things I accomplished in just a couple hours total and in this post all the pieces that went into making that happen so effortlessly:

Wrote a brand new app that does a simple job, built quickly but easy to expand and improveIncorporated persistent data for a totally…

Respect and Code Reviews

Code Reviews in a development team only function best, or possible at all, when everyone approaches them with respect. That’s something I’ve usually taken for granted because I’ve had the opportunity to work with amazing developers who shine not just in their technical skills but in their interpersonal skills on a team. That isn’t always the case, so I’m going to put into words something that often exists just in assumptions.
You have to respect your code. This is first only because the nature and intent of code reviews are to safeguard the quality of your code, so even having code reviews demonstrates a baseline of respect for that code. But, maybe not everyone on the team has the same level of respect or entered a team with existing review traditions that they aren’t acquainted with.
There can be culture shock when you enter a team that’s really heavy on code reviews, but also if you enter a team or interact with a colleague who doesn’t share that level of respect for the process or…

Why I Switched From Git to Microsoft OneDrive

I made the unexpected move with a string of recent projects to drop Git to sync between my different computers in favor of OneDrive, the file sync offering from Microsoft. Its like Dropbox, but "enterprise."

Feeling a little ashamed at what I previously would have scoffed at should I hear of it from another developer, I felt a little write up of the why and the experience could be a good idea. Now, I should emphasize that I'm not dropping Git for all my projects, just specific kinds of projects. I've been making this change in habit for projects that are just for me, not shared with anyone else. It has been especially helpful in projects I work on sporadically. More on why a little later.

So, what drove me away from Git, exactly?

On the smallest projects, like game jam hacks, I just wanted to code. I didn't want to think about revisions and commit messages. I didn't need branching or merges. I didn't even need to rollback to another version, ever. I just …

I Learned 4 Things From my First Ludum Dare

I've done my first Ludum Dare Jam now, and actually my first game jam of any kind. Wow! I am so happy to have finally done this. It was a super rewarding experience and I want to share that, and my game, with as many people as will listen.

My game is Patient Out Of Time. It is an apocalyptic moody shooter about a doctor salvaging power sources from robots in the wasteland to keep the life support of his last patient running as long as possible. The hospital staff have all left, and they are the only two survivors. Keeping this man alive is all this one doctor has to keep him going.

It is a sad game, but it was also a lot of fun to make.


Here are some things I learned this time. I hope to learn more things the next Ludum Dare.

Little Steps Make Safe Steps I didn't have time for broken builds or half-built code I needed to fight my way back out of just to get the game running again. Every change I made had to be broken down into tiny, discrete non-breaking changes. Every step of…

Game Development is Hard, Okay? 5 Things That Suck About Making Games

Game development is hard. I mean, really hard and everyone knows it. You probably won’t finish your game. You probably didn’t finish several games before it. You’ll probably start some more games you’ll never finish. The thing is, not finishing the games isn’t the only reason game development is hard. Let’s learn from some of my failures so far.
Taking Time From Your Family is Hard
Putting it like this sounds kind of distasteful. Yeah, if you’re working on your game in the time you aren’t at your day job, there’s a good chance you’re taking time away from precious family time. You’re missing evenings with your wife. You’re skipping days with your kids growing up. If you don’t have a family in your life, you’re opting out of time with friends, watching movies and reading books, or even just playing games, the same medium you obviously care a lot about.
Making games takes a lot of time. You think you know that, but it takes more time than you already fear. Double that number in your head. …

On Pruning Your Passions

We live in a hobby-rich world. There is no shortage of pastimes to grow a passion for. There is a shortage of one thing: time to indulge those passions. If you're someone who pours your heart into that one thing that makes your life worthwhile, that's a great deal. But, what if you've got no shortage of interests that draw your attention and you realize you will never have the time for all of them?

If I look at all the things I'd love to do with my life as a rose bush I'm tending, I realize that careful pruning is essential for the best outcome. This is a hard lesson to learn, because it can mean cutting beautiful flowers and watching the petals fall to the ground to wither. It has to be done.

I have a full time job that takes a lot of my mental energy. I have a wife and a son and family time is very important in my house. I try to read more, and I want to keep up with new developments in my career, and I'm trying to make time for simple, intentional relaxing t…