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!

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.

A takeaway I often get from exploit writeups

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.

Short thread about LLDB pretty printing internals

Tips for writing LLDB pretty printers

LLDB supports custom scripts (“variable formatters”) to pretty print C++ data structures. For example, std::vector is typically implemented as a struct with three pointers: begin, end, and capacity. But if you wanted to print out a std::vector variable during a debugging session, printing out these three pointers isn’t likely to be helpful. What you actually want is to print the contents of the vector. Pretty printer scripts allow for doing this for your own data structures.1

Here are a few tips to supplement the official documentation. Sudara also has a great post on the topic.

Continue reading