The Mindset Shift I Adopted After Recovering From Burnout

By the end of 2023, I had burned out.

I had tied my sense of purpose to my job while forgetting my health and hobbies. That took a toll on me.

To recover, I started with an information diet. No more mindless scrolling, Hacker News, or even music. Just talks from creators who have been through it. Borja Vilaseca was one of them.

Another inspiring figure was James Altucher. I read about his bankruptcies and how he bounced back. I started to follow one of his habits: doing something for my mind, body, and spirit. He calls it: The daily practice.

Since recovering, I’ve embraced a simple mantra: one day at a time.

No matter how tough the day is, trust God (or the Universe or Life) and rest. Tomorrow is a fresh start.

Stop time traveling. Because living in the past makes you resentful, and worrying about the future makes you anxious. Stay present.

The Worst Financial Tip I Ever Got—and What to Do Instead

“Use your credit card only for emergencies.”

Sure, there are good intentions behind that tip. Credit cards have some of the highest interest rates on the market. And, like any debt, they’re a loaded gun. Treat them carefully or they’ll hurt you.

But for emergencies, taking on debt with a high interest rate isn’t a good idea. So how do you prepare for emergencies? With a financial cushion.

The Richest Man in Babylon taught me about a financial cushion. It’s one of the best money books I’ve read. “From every 10 coins you earn, keep 1 and spend the other 9.” That’s how I remember the lesson. That simple habit helped me survive a layoff and even afford a mini-retirement.

Use your credit cards like cash. If you can’t afford it, don’t swipe. Cards are a payment tool, not a source of money you don’t have.

I'm Stealing Some of Reddit's C# Extension Methods

Today, I found this Reddit question asking for the lower effort extension methods we’ve written.

And like any real C# programmer, I have my own set of extension methods to work with collections. But I ended up stealing one method from that thread: Choose(). It applies a transformation to a list and only returns the resulting values different from null.

It turns out, Choose() comes from F#’s List type. So my next step was to sneak into F#’s List type and steal some of its methods.

Here they are,

public static IEnumerable<U> Choose<T, U>(this IEnumerable<T> source, Func<T, U?> selector) 
        where U : class
{
    foreach (var elem in source)
    {
        var projection = selector(elem);
        if (projection != null)
        {
            yield return projection;
        }
    }
}

public static U Pick<T, U>(this IEnumerable<T> source, Func<T, U?> selector)
        where U : class
    => source.Choose(selector).First();

public static U? TryPick<T, U>(this IEnumerable<T> source, Func<T, U?> selector)
        where U : class
    => source.Choose(selector).FirstOrDefault();

public static IEnumerable<T> Replicate<T>(this T source, int count)
{
    for (int i = 0; i < count; i++)
        yield return source;
}

public static IEnumerable<T> Singleton<T>(this T source)
{
    yield return source;
}

And here’s a quick example of how to use them,

var movies = new Dictionary<int, string>
{
    { 1999, "The Matrix" },
    { 2000, "Gladiator" },
    { 2008, "The Dark Knight"},
    { 2003, "Freaky Friday"}
};
var years = [1995, 1997, 2010, 2003, 1999, 2000];
years.Choose(movies.GetValueOrDefault)
// "Freaky Friday", "The Matrix", "Gladiator"

years.Pick(movies.GetValueOrDefault)
// "Freaky Friday"

Friday Links: PHP turning 30, reading code, and passion

Hey, there.

Here are 4 links I thought were worth sharing this week:

#1. PHP was my first love. I spent countless hours coding a recipe catalog using CodeIgniter to learn coding. To my surprise PHP just turned 30. And after 30 years, PHP has become the Toyota Coralla of programming (9min).

#2. It’s easy to spot AI-generated posts. Just look at the opening sentence. Look for anything like “In today’s fast-paced world.” But what about code? Here’s how to know when someone is vibe coding (3min).

#3. Reading code is an underrated coding skill. These days of too much vibe coding, reading code is the forgotten skill. If vibe coders only read the f*ing code (9min).

#4. What’s the secret behind success? It seems passion has a lot to do with it (2min).


And in case you missed it, this past week I wrote on my blog about how programming is becoming prompting (2min) and 7 life events that deserver a “shower” too (2min). That last one was half-joking. But the business shower doesn’t sound that crazy.

Last week I found out a Brazilian YouTuber translated one of my posts and reacted to it on his channel. I share the video here. Funny things that happen.


(Bzzz…Radio voice) This email was brought to you by… Check my Gumroad store to access free and premium books and courses to level up your coding skills and grow your software engineering career.

Coming soon: the “C# Fundamentals Bundle,” all of my beginner-friendly C# video courses to help you master the language from the ground up. Launching in just a few weeks, so stay tuned!

See you next time,

Cesar

Want to receive an email with curated links like these? Get 4 more delivered straight to your inbox every Friday. Don’t miss out on next week’s links. Subscribe to my Friday Links here.

5 Things Every New Coder Should Watch, Ask, Read, Do, and Pass On

While curating this week’s Friday Links email, I found out about Dense Discovery and got inspired.

That newsletter features a section called Worthy Five where a subscriber shares 5 things worth watching, reading, asking…

So I’m stealing (like an artist) that idea, and tweaking it for new coders:

#1. A video worth watching.

Well, it’s more a lecture series. Watch Stanford CS106A on YouTube.

That’s an introductory course to programming. I watched all the lectures in the 2010s while learning to code. I loved the energy of the teacher and the exercises using video games to teach programming concepts.

Watch the first few lectures, you’ll love it.

#2. A question worth asking.

Ask what you want out of your career.

I jumped from job to job without any plan until I got bored or fired. At the end, I burned out after trying to make a “good” job work for me. I never took the time to set an intention for my career.

Come up with a career plan or goal. Remember you can always change it.

#3. A book worth reading.

OK, let me give you two.

First, Clean Coder. I enjoyed this one more than Clean Code. Clean Coder isn’t about writing code, but about being a professional developer. It covers professionalism, unit testing, and estimates.

The other one? Code That Fits Into Your Head. This isn’t precisely a book on syntax, but rather one about programming practices. Its main point? Write code in such a way you can keep its details in your head.

If you don’t know which one to pick first, go with Clean Coder.

#4. An activity worth doing

Write!

I’m biased here. I love writing. But, seriously, write anywhere online. To put your thoughts on paper. To document your learning.

Writing opens doors you can’t even imagine. For example, my blog has done more than a portfolio.

If you don’t know how to start, write TIL posts.

#5. A piece of advice worth passing on

Back at my first job, a coworker gave me this piece of advice:

Imagine you only make half of your salary, save and invest the other half.

Probably the best piece of advice I’ve received for free. Here are another two I never asked. That one helped me survive a layoff. Definitely worth passing on.