DEV Community

Cover image for A fun story about coding
Nasser El Idrissi
Nasser El Idrissi

Posted on

A fun story about coding

It all started on a lazy Sunday afternoon. You know those days when you’re just scrolling mindlessly through Twitter, and your browser starts acting up? Yeah, one of those. My ARC browser was being particularly dramatic that day, probably throwing a tantrum because I had about 47 tabs open (don’t judge, we all do it - that’s why we switched to ARC in the first place, right?).

So there I was, desperately trying to figure out why my RAM was disappearing faster than free pizza at a developer meetup. I opened Activity Monitor, but come on - its interface looks like it was designed in the era when people still debated tabs vs spaces. That’s when nostalgia hit me, and I found myself missing the clean, terminal-based beauty of htop from my Linux days.

“Let me home brew a htop (I don’t have it installed on my mac, like seriously? during my career I used monitoring tools like top, htop, 3 or 4 times and I’m not even kidding, like what the fuck I’d need them for? 🤷‍♂️), then I thought wait is there a decent gui alternative for macOS,” I thought. Big mistake. Or maybe the best mistake ever?

After browsing through some alternatives that looked like they were designed when dial-up internet was still cool 💾, I had what alcoholics call a “moment of clarity”: “Hey, I’ve been meaning to learn Rust, and everyone’s talking about this Tauri shit… and I don’t want to build the next 1 billion dollar todo list app 🤔”

“How hard could it be to build a system monitor? It’s just numbers going up and down, right?”

Oh, sweet summer child.

First stop: The Rust book. You know, the one everyone says you should read cover to cover before even thinking about writing “Hello, World!” I made it halfway through, just enough to understand ownership and borrowing (which is like learning about relationships in therapy - it’s all about who owns what and who’s just borrowing feelings), and that Traits are basically Rust’s way of doing interfaces like in Go. Then I had my second moment of clarity: “Wait a minute, Rust is a systems language… there’s gotta be a crate for system stuff, right?”

Turns out, there were like fifty of them. But hey, decision paralysis is just part of the modern developer experience, right?

Now for the frontend. Tauri is framework-agnostic, which means I could’ve used React or Angular. But let’s be real - shipping your app with React is like bringing an entire orchestra when all you needed was a kazoo. Plus, I’ve got principles, dammit! That’s when I remembered Svelte, that beautiful compiler-first framework that React developers are now trying to copy with their “compiler magic” (How’s that for innovation, Zuck?).

The first iteration was… functional. Basic Tauri invokes were working (just sprinkle invoke() everywhere like it’s fairy dust ✨), but it looked about as exciting as a terminal running ping. And if we’re making a GUI (and not shipping an entire Chromium instance like some other electron-ic frameworks I could mention - yeah, we’re using native webview because we’re not monsters), it better look good. That’s when the icon adventure began…

I spent THREE DAYS just trying to figure out how to get proper icons for processes. THREE. DAYS. The solution? A weird combination of SimpleIcons and some regex magic that I’m pretty sure summoned a minor demon in the process.

But then something magical happened. The UI started coming together, and it actually looked… good? The dark mode wasn’t burning my retinas (looking at you, htop), and the performance metrics were dancing across the screen like they were at a disco.

You see, I’d been spending way too much time on Reddit looking at those fancy neofetch screenshots that cool kids keep sharing (you know the ones - where their terminal looks cooler than most people’s entire desktop setup). That’s actually what inspired the name “NeoHtop” - a little nod to neofetch and its aesthetic-obsessed community. But why stop at just pretty colors?

That’s when it hit me - if developers can spend hours customizing their code editors 🎨, why not let them do the same with their system monitor? Making the app themable wasn’t just about looking pretty; it was about giving users that same dopamine hit they get from perfectly customizing their VS Code setup. (And let’s be honest, we all know at least one developer who spends more time theming their editor than actually coding.)

I threw in some fancy animations, because why not? If we’re monitoring system resources, might as well do it with style. The irony of potentially using more resources to monitor resources was not lost on me.

And I kept going! Because apparently, I can’t leave well enough alone. I added search functionality (because scrolling is so 2023), filtering by status (for those who really need to know which processes are “sleeping” - you know, like we all wish we were), and even pagination (why would an activity monitor need pagination, you ask? Well… I asked myself the same question, but couldn’t come up with a good reason why NOT to add it 🤷‍♂️).

I even wrote a few posts about it on Reddit and dev.to, with a little help from ChatGPT (because who has time to write coherent sentences when you’re busy adding unnecessary features? 🤪). That backfired a bit when some keyboard warrior on dev.to decided to call me out for using ChatGPT - which I hadn’t even denied! But karma works in mysterious ways: the post got so popular that dev.to blessed me with some admin superpowers. Let’s just say certain negative comments found themselves taking a journey to the bottom of the thread. Hey, with great power comes great… ability to reorganize comments? 😈

Then came the real “oh shit” moment. Thanks to Marouane (my friend and coworker who I’ll never forgive for this), I decided to post it on GitHub, thinking “maybe a few people will find it useful.” You know, the usual: mom, my puppy, and that one friend who stars everything I post.

But apparently, I wasn’t the only one who thought Activity Monitor needed a glow-up ✨. Within 24 hours, the stars started rolling in. By day six, we hit 1,000 stars 🌟. My notifications were going crazy, and my impostor syndrome was having the time of its life…and started asking myself what is this madness? what am I doing with my life? Am I going to spend the rest of my life replying to peoples issues on GitHub? I mean, I love open source and all, but I had a life too! and a little kid to take care of! and a wife! and a house! and a mortgage! and a cat! and a dog! and a life! what the kind of shit I stepped into now?.. anyways it’s just a little tool right? not like I’m building the next big thing here…a bit of a stretch, but ok.

The best part? People actually started using it! Real people! And they were sending PRs and opening issues for suggestions.. stupid ones but also lot of good ones too!

And here we are now, with a full-featured system monitor that started because Arc was being a memory hog for the first time in months. The moral of the story? Sometimes the best projects come from the most mundane problems. it not really about the project, it’s about the process.. the experience.. the journey.. the lessons.. the people.. the laughs.. the memories.. what the fuck am I doing with my life? what memories? what laughs? what lessons? what journey? what process? what project?… just kidding, it’s about the learning by doing.

P.S. If you’re wondering about the version history (spoiler: there were a lot of “fix typo” commits hidden in the commit history under other commits messages like “updating dependencies”, “updating icons”, “updating download links”, etc.):

Yeah, we’re at 1.0.5 now. Each version bump represents at least one “it works on my machine” moment and several sips of coffee.

Remember kids: Sometimes the best way to learn new tech is to build something you need, even if you end up way over your head. Just make sure to add some nice animations – they hide the pain of debugging memory leaks. And if you’re going to name your project after something, might as well pick something that the cool kids are already hyping up on Reddit! 😅

P.S.S. If you’re wondering how I’m writing this post, remeber I’m not using ChatGPT for this one.. with great power comes great responsibility.

Give NeoHtop a try, it’s free and open source: NeoHtop on GitHub

Top comments (0)