josh.code

Posts

Why I Prefer Errors to Exceptions

I recently saw a video pop up in my YouTube feed, “Why I Prefer Exceptions To Errors” by ThePrimeTime. The title is a little misleading, as it refers to an article that Primeagen is reacting to. In the video, he makes a case for preferring Errors over Exceptions. Before jumping in, I want to talk about Primeagen. I am not a subscriber so I do not see every video, but the videos that I have seen about software and what it means to be a software engineer are clearly based on experience and knowledge.

A Few More Thoughts on React

A Few More Thoughts on React
I had a few more thoughts after I made my last post. Simple Made Easy I realized after posting that my thesis is along the lines of “Simple Made Easy” by Rich Hickey. If you have not seen the talk watch it now. The titular idea is that simple <> easy. Expanding on this: Simple - not complicated Simple is only having to track a few things in your mind. State is never simple State complicates everything that touches it.

Why I Like React (even in 2024)

Why I Like React (even in 2024)
I recently read a post about React being antiquated. I have liked React for a long time (here is a local meetup talk I gave in 2015?! https://ejosh.co/de/2015/08/my-talk-on-react/ ). I am not really posting this as a rebuttal to the other post, but to shine a light on the core paradigms of React which are still valuable in 2024 and beyond. Before getting to the thesis of my post there is a great article (https://joshcollinsworth.

Docteur Bizarre

DALL-E created image of an Onion at a Parisian fle market
This is a story that starts in Paris and ends in Regency era England. My wife and I recently returned from a trip to London and Paris. During our visit, we explored the renowned Les Puces de Saint-Ouen flea market in Paris. It is a maze of booths and buildings of booths with hundreds of vendors selling everything. We find a stall with a selection of books priced at €1. One particular book caught my eye as there is a face of an onion-headed man (🧅👨) staring right at me.

Stream a Massive Gzipped Json File in Python

DALL-E created image of the Python logo as the source of data waterfall
I found myself with the problem of having to process massive JSON files that were gzipped. The files were 6.8GB gzipped and over 50GB un-gzipped (de-gzipped?). I found myself here because a new regulatory requirement called “Transparency in Coverage” that took effect on July 1, 2022 for Insurance companies to post pricing information that is machine readable. There is a guide with examples out on GitHub. Unfortunately the examples in no way reflect the actual size of the data.

Dont throw exceptions in CSharp use Monads

Nick Chapsas recently released a great video “Don’t throw exceptions in C#. Do this instead”. The quick summary is to not throw exceptions but to use the Result type from LangExt. Nick makes great videos, but there are a few things I want to correct/add to and respond to concerns from the comments. Before we go any further, I LOVE LangExt. I consider it a must-install in any project. Misunderstanding Monads The main reason Nick presents to use Result over throwing exceptions is about performance.

Migrating From Wordpress to Hugo

DALL-E created image showing Hugo on a hill
I recently migrated this site from Wordpress to Hugo. The site had been on Wordpress since 2011. I had wanted to do something different than Wordpress for a few years, but I never knew what I would migrate to. I looked into static site generators which lead me to Hugo. Wordpress made starting a blog easy. I definitely would recommend it to anyone that wants to write their thoughts down, provided that it is through one of the many hosted Wordpress sites.

Simple React Drag and Drop

Up until recently I haven’t had the need to use drag and drop in my React projects. Then I did have the need. My need was simple, a list that could be reordered. I went searching for an example and everything I found just felt too complicated. I wasn’t worried about making it work. I was worried about having way too much boilerplate to reorder a list. I decided on using react-beautiful-dnd.


Practical Functional JavaScript: Why React and Redux? Video

This video series mirrors the blog post series on creating a functional application in JavaScript. This will map closely with the second post of that series. We will cover putting our functional backend together with the DOM. This is where the application becomes a useful item and not just a bunch of functions. In addition to this, we will cover fundamentally why React and Redux are awesome. While we do not use the actual React and Redux libraries, we use the same thinking behind our render functions and state management.