Author Archives: Mark

About Mark

Ten years into my journey towards becoming a pro systems programmer, sharing what I learn along the way. Also on Twitter: @offlinemark.

If you're reading this, I'd love to meet you. Please email mark@offlinemark.com and introduce yourself!

How to enable colored compiler output with CMake + VSCode

Assuming you’re using the “CMake Tools” VSCode extension, here’s what works for me.

1 – Set CMAKE_COLOR_DIAGNOSTICS to ON in your environment

This makes CMake pass -fcolor-diagnostics to clang. If you build on the command line, you’ll now have color. But the VSCode “output” pane will still be non-colored.

2 – Install the “Output Colorizer” extension from IBM.

This adds color to the Output pane.

It looks like this:

Links:

https://github.com/ninja-build/ninja/issues/174

https://github.com/microsoft/vscode-cmake-tools/issues/478

WIP: Should everyone be a leader?

I’ve been thinking about leadership lately.

Many children’s programs are designed to foster leadership skills. Why? Does this imply that everyone should have leadership skills? That everyone should be a leader?

This interests me because for the longest time, I never felt like a “Leader”. I didn’t have anything in common with “Leaders” I saw. It didn’t resonate.

But I’ve realized the answer is yes. Everyone should learn leadership skills.

Even if you have no aspirations to start a company or lead a nation, leadership is everywhere.

It’s obviously present on smaller scales — in local organizations, communities, and workplaces. And even if you don’t aspire to be at the top, in any non-trivial organization, it’s still leadership all the way down. Even if you explicitly reject managing people, you can still find yourself as a leader — for example, being a skilled individual specialist carries leadership in its own way.

But less obviously, as soon as you start any kind of project or endeavor of any kind — guess what, you’re now a leader. Any kind of pursuit creates an opening for a leader. By default, the creator fills the role.

Examples of endeavors:

  • Starting a family
  • Co-creating a relationship
  • Organizing a party
  • Planning a trip
  • A creative practice

Without leadership, you can only ever be a “leaf” node, at the end of the chain. Without leadership, you can only ever be a consumer, a viewer, an audience member.

Even if you never start any endeavor, at the very least, you are the leader of your own life. (Which, by the way, is a creative project.)

So, yes, everyone should have leadership skills — not because everyone “should” be a leader, but because everyone already is.

Why I enjoy hanging out with entrepreneurs

I’ve been a regular attendee at the Indie Hackers Berlin meetup lately. I’m not particularly an entrepreneur myself, but I love hanging out with them because they generally have many of the following qualities:

  • High functioning
  • Smart/Clever (to be successfull, you kind of have to be)
  • Ambitious
  • Creative
  • Unconventional thinkers
  • Into self development
  • Leadership

All of which make them very fun and interesting to be around!

Why I write in public

Note to self. I write because:

  • Improved clarity of thought
  • Archive of thought
  • Improves writing skills

In addition, I write in public because:

  • It reinforces a mindset of speaking my mind in public (i.e. courage)
  • Receive valuable feedback and external perspectives
  • Build & maintain relationships — people can learn about me and keep up with what I’m up to

Furthermore, I’ve found that it’s addicting to write in public.

  • It feels good to look back on writing and realize you’ve expressed yourself clear and well. And that you understand the topic well know.
  • It feels good to develop a voice.
  • It feels good to watch yourself improve. You can write better, faster with practice.
  • You become more self-observant of your thoughts, and realize that there are so many interesting things to write about.
  • It feels good to get positive feedback on your writing.

Edit: 2023-08-01

Furthermore, I think it’s a good idea to even default to sharing in public (vs writing in a private Note app, then selectively copying to publish).

If you get busy and don’t get around to that explicit publish step, there is a 0% chance that anybody else might discover your work, which might actually be very good. If you default to publishing publicly, that doesn’t mean you need to actively promote it, but at least there’s a nonzero chance of someone finding it eventually.

Can we have non-atomic std::shared_ptr in C++?

Turns out, we do have them. libstdc++ contains a heuristic kludge where it checks if libpthread is linked into the process and conditionally executes an atomic add or non-atomic add depending on the result. Post 2020, it doesn’t directly use the libpthread hack, but uses glibc’s native support for this.

These kinds of things always make me sad about C++ (especially compared to how nice and clean things seem to be in Rust world), but at least it’s nice knowing that the committee did consider it and there are good reasons why to not have this in the C++ stdlib. The most compelling reason is that in the absence of a borrow checker, it is all too easy to silently use a non-atomic shared_ptr in multithreaded code.

Full thread:

Location Capital

Traditional forms of capital include money, relationships, and health. There’s another I’ve discovered but never heard mentioned before: location capital.

Location capital is how much experience you have with a physical place on Earth. For example, if you have a lot of New York City capital, you’re the one that knows all the cool restaurants and bars in NYC. Friends ask for recommendations for the perfect spot for their birthday.

Everyone has location capital of some kind. But no one can have all the location capital for every place, so everyone (even Jeff Bezos) needs to decide what places are most important for them to build capital in.

It’s useful to be aware of location capital because it can affect your decisions around where you spend time.

Let’s say you’re alone and deciding whether to eat out at a restaurant you’ve never been to. What’s the cost/benefit? In exchange for money, you get good food and save time & labor (from not cooking/cleaning/grocery shopping).

But that’s not all — because you’re going to a new restaurant, you also build location capital. This is a one-time “boost” you get from going to a new place. On further visits you’ll still get some, but less.

Your decision will ultimately depend on how much you value food, time, labor, money, and location capital.

Location capital can also act as a hedge against risk. If you’re planning a date, preferring a new place will help make sure your time isn’t totally wasted if the date goes poorly.

I wish I was aware of location capital sooner. I used to prefer staying in over eating out in order to save money. But now I realize those decisions came with opportunity cost. And as a result, I’ve built less capital for the cities I’ve previously “lived” in than I’d like.

In general, I think it’s a good policy to always be building capital (mostly the non-monetary kinds). Location capital is an interesting form of it and being aware of it can influence how you live your life.

Remote onboarding

The biggest challenge when onboarding remotely was getting a feel for the culture. Without this, you have to play it safe and act conservatively (i.e. maximally professionally), however it can be draining to always be so buttoned-up.

The two things that helped me feel more comfortable were:

1. Seeing “micro unprofessionalisms” during zoom calls.

One colleague had a large drawing of “No Face” from Spirited Away on his wall.

Another’s cat jumped onto the desk, and then a baby ran into the room.

Another just had a mess in the background.

All of these show humanity and personality. They let the new team member know that the tone is relaxed and that there’s no need to stress over behaving perfectly “professionally”.

2. Getting hints from coworkers about work norms.

I have a coworker that’s brutally productive. But one day he said, “I’m going to be out for a few hours this afternoon to get my trombone fixed.”

It’s easy to overlook such a remark if you’re been on the team a while. But for a new joiner, even small comments like this provide valuable insight into what is and isn’t acceptable on their new team.

To make your new team member’s remote onboarding experience more comfortable, be intentional about showing humanity — visibly display things that are unique to you (and un-blur your background). Also, remember that your team’s culture exists, must be learned, and can be proactively communicated.