December 9th, 2019
I don't want to admit it, but I spent the last 5 days rebuilding the main data grid feature for my product.

I basically worked all day every day - I needed to rebuild it because of some big performance issues that customers were facing.

Why were we facing performance issues? Two reasons - I picked a "toy" library months ago, and I wasn't smart enough at Javascript to fix it myself.

This rebuild has been nagging at me for months. I needed to do it. This last week was the week to do it.

"Pick the best library"


I knew I needed to use a good library, but this time, it better be a "good one". So I did a bunch of research on the best table / datagrid libraries for React, and I decided to go with react-data-grid.

A couple hours into it, I was flying high. Everything was working great, I had implemented about 60% and it was looking slick. 

Then I found an issue. Then another.

Hours go by, I'm making progress, but a lot slower now.

I find myself scouring Github issues from 3 years ago, unresolved, stale. I see someone else is having the same issue as me, but nobody responded. Damn...

I find myself in an endless loop on the same Github issues and Codesandbox examples.

I stumble on a thread with dozens of comments about how the library is unreliable and the owner is unresponsive.

Eventually, I give up.

"Pick another library"


"Fuck, I'm 2 days in and I'm switching libraries? I'm a loser."

I'm going to a more low-level library, react-table.

This library looks promising, the owner is constantly making changes, the library is well-maintained and well supported.

And plus, a lot of the work I've done can carry over, implementing this new library should be much easier.

I go back into the zone, implementing faster than last time, I'm almost surprised at my Javascript skills?

I know a lot more than I did about Javascript last week...

I'm about 80% done, now I need to implement this last feature (spreadsheet grouping).

I cannot figure this one out! I feel stupid. I look at the examples over and over - they are using React hooks and memoization. I don't get it.

I put in debuggers and try everything. Hours go by, and I'm so frustrated.

I'm scouring Github issues and realize the feature doesn't work in the current version, they are working on fixes...

FUCK!

"Take a break"


I take a break for a couple hours, my first break in what feels like days.

I hop in the shower. It's a long shower. I'm starting to have shower thoughts, reflecting on my implementation and what I've learned. All I can think about is this project. I NEED to get it done.

With this sudden break in coding, I have a revelation: "Fuck it, I can just build this myself"

I scrap the lower-level library.

I implement it myself with pure React and javascript.

I do it in less than 2 hours.

"How was it that simple?"

I feel confident. I understand how the thing truly works.

I'm excited about the code. Adding features will be easy. I won't need to comb through broken documentation and closed Github issues when I want to add XYZ. I'll just build it myself.

--

Felt like I had to write this down, as the last few days were such a roller coaster.

But after ripping out my hair, yelling at my computer, screaming with joy, and dreaming every night about code, it's done now. It was all worth it.

Deploying tomorrow.