It’s been a while since my last blog post on building a basic trivia app using React with Redux-less global state — quarantine has been weird and time for personal projects ebbs and flows, but I’m back at it. When I last left off, I had set up global state using just React hooks and the Context API, and tested basic functionality by making an external API call and saving the result to my store. My next step is to set up some basic app usage with this store data available. …

Photo by Anne Nygård on Unsplash

When I learned React, the bootcamp curriculum featured a blend of class and functional components, hooks were covered in just a single afternoon lecture, and we used Redux for global state management. Ever since starting my post-bootcamp career, I’ve been working pretty minimally in JavaScript, and all in either vanilla JS or jQuery. The React world has also had a lot of exciting changes and certain norms have been codified in the meantime. Everything is functional components now and hooks are the way of the future, but my interest was really piqued by hearing that global state is now possible…

Let’s start at the end, a very good place to start.

As I suspect a lot of people feel at some point, writing recursive functions seemed dense and counterintuitive to me for a while. You call a function, inside that function itself? How does that even work? Why would you do it? What’s the actual design pattern of making it properly?

While working through a coding challenge, I finally had a breakthrough that helped me answer all those questions, as well as identify the source of my previous hang-ups. I realized that I’d been approaching recursion problems backwards, because I’d…

With the release of MacOS Catalina, Apple has abandoned the bash shell in favor of zsh. After adjusting, I actually prefer zsh. It’s user friendly, even more so with the virtually-essential oh-my-zsh plugin, and I really like the file navigation and autocomplete features.

Much to my dismay, however, I found that my older Rails projects were not playing nicely with zsh. Trying to bundle i or rails s especially seemed to be leading me around through an Ouroboros of error messages. Missing gems, wrong permissions to install said gems, and the Terminal insisting “Your Ruby version is X.X.X, but your…

Programmers are lazy. But, like, the good kind of lazy. When you’re trying to piece together a particularly tricky project, why make life difficult for yourself with nuts and bolts? Most major editors come with a wide array of plugins explicitly intended to move mental effort away from coding basics so you can focus on making your actual product the best it can be.

My favorite editor hands-down is Atom, made by the team from GitHub. Although Flatiron recommends VSCode officially, I’ve really enjoyed Atom due to the customizability that‘s so core to its design philosophy. …

*(neither fun nor profit guaranteed)

Let’s say, hypothetically, that we’re building a mini-RPG battle game. You know, like my partner German and I were for our Flatiron Mod 4 project. We want users to be able to select various items like weapons, armor, etc. and battle against other users with their selected loadout. When selecting their equipment, we want users’ options to be laid out in a nice little grid like the above. We’re working in React and have installed Semantic UI React in our project. …

As developers, we often need to gather data from external sources for use in our own programs. Doing this in JavaScript used to require clunky code or the use of outside libraries, but fortunately the Fetch API has in recent years made retrieving, adding, editing, and removing data from external databases easier than ever before. This API works by providing and resolving a series of promises. Let’s break down this process with a few examples.

A basic fetch

At its core, fetch only requires one argument: the location where it should send its request (which by default is a GET request). So if…

Beware! Read on to find out why.

As an object-oriented language, Ruby (and by extension, Rails) supports the use of classes to give context and functionality to the various object instances used throughout the program. These classes are all inter-related to each other in some way or another, and while many exist to model real-world objects, many exist only to store the relationship between those other classes. Rails, with its goal of making our programming lives as easy as possible, has provided an out-of-the-box way to create these model-linking models (called join tables) quickly and easily. …

When I started learning Ruby, I started noticing code snippets like the following: { |name| name.upcase }


name_array.find_all do |name|
name.length > 5

What are those little pipes for? Where did the word inside the pipes come from? What’s that second part inside the curly braces or do-end statement? It kind of looks like a conditional, but I don’t see any if-else statements so it’s just sitting there on its own? What is going on here???

Pete Hanner

Former paralegal gladly opting for programming instead of law school. Engaged in a years-long, steady migration northward.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store