I just figured out how to do filesystem routing like the kind supported by Nextjs, but for Nodejs API’s implemented in express. Check out the commit on my GitHub:
https://github.com/abraham-serafino/simple-security/compare/main…express-file-path-routing#diff-3b62bfb52c340d82485e1a1712ac89b98c5c8f55499990329997e0c692ac620d
Cyberpunk
Unit Testing a Linked List
I believe integration tests are the most valuable type of automated test. A linked list is usually part of a standard library, so that makes it a great example of a candidate for integration testing.
My guideline is, “one test per requirement.” For example, for a Linked List, I would probably start with one test for each of the following:
1) Can values be prepended, 2) inserted at a given index, and 3) appended?
4) Can values be removed without compromising the list’s integrity?
5) Can the list be traversed forward and (for doubly linked lists), 6) backward?
7) Are we preventing out-of-bounds access?
8) Any potential type safety requirement
9+) Each potential memory efficiency requirement
…) Each potential runtime requirement
TikTok
Studies show the average person spends over 6 hours per day looking at screens, with almost 3 of those hours spent on mobile devices, consuming a constant stream of audio-visual content. Human brains are not optimized for this type of continuous, passive consumption; they are optimized for in-person conversations and kinetic interactions with a physical environment.
While I understand the challenges the upcoming potential TikTok ban poses for creators and employees, I believe dopamine-driven apps that bypass critical thinking and offer little lasting value ultimately create a societal net negative.
The proposed TikTok ban in Congress raises a crucial question: how can we foster healthy online habits that prioritize meaningful interactions over mindless scrolling?
Anhedon
Is the greatest sound that makes the body blind.
Questions in the ether;
My slow thinking is seeing
The big picture.
You can’t comprehend the details.
As you inhale,
I’m analyzing from every conceivable angle.
I can’t speak, I can’t eat, think, or sleep.
Heard that somewhere but it sounded cheap.
Have you ever gone for days, mind in a haze,
Wishing you could focus on something – anything –
Trapped, lost in a malaise?
Give me a break.
The systems you’re creating are at stake.
I could fix it – tear down and rebuild –
Listen, blind leader!
You’re making a mistake.
Remember when I said one tone – empty mind?
How long until the body goes blind?
Write bad code
A friend of mine used to quote a friend of his, who said, “always behave as if your worst ten lines of code will be written on your tombstone.” I took that advice to heart.
Throughout my career, I’ve always tried to avoid writing bad code. Software is a craft, and quality beats quantity. I want to write the 10 lines of code that can do the same thing as someone else’s 6000 lines – and do it better.
But every time I write “good” code, I find myself looking back over it almost immediately, with some very specific ideas about how I could rewrite it to make it better. In fact, I usually cringe. If only I hadn’t over-engineered this part, or had used composition on that part. Unfortunately, there are deadlines to meet. Once the bad code has been written, it has to be shipped.
All of the code I have ever written, no matter how good it was, turned into bad code as soon as I was done writing it. It almost makes me wonder… should I just write bad code?
And the answer is, “yes.”
Every accomplished author knows that you need to get 10,000 pages of rubbish out of your system before you can get to the good stuff. Similarly, you will never know what good code looks like until you’ve written lots and lots of bad code. The more “bad” code you write, the better your code will get. Other people will eventually start to look at code you’ve written and be impressed. And you will still cringe.
All the code you write in the future will (*should) be better than all the code you’ve written in the past. So write bad code.
What else is there?
There is really no reason…
…Why this playlist should have so few views and likes.
https://www.youtube.com/playlist?list=PLiTEQmUOQAZw59lQMdCM0NFdP036Zltvz
Probably NSFW