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!

Don’t confuse std::move and std::forward

This was a pretty interesting buggy scenario I found while reading the clang-tidy checks. If you’re writing a function that takes a forwarding reference (what looks like an rvalue reference, but whose type is a template argument), you need to be careful to not call std::move on it. You need to make sure to call std::forward instead. Otherwise, you might accidentally trigger a move on an object passed by a caller! This would be confusing, since their object would be moved from, and they never explicitly called std::move on it.

Continue reading

Getting bit by unique_ptr

I got bit by unique_ptr when implementing a linked list today. You need to be careful to manually release() the unique_ptr before resetting or you might accidentally free the entire list. This comes up when doing insertions and stuff like that.

People hate surveys, but like being interviewed

(Originally appeared on my Indie Hackers blog)

Instead of posting a link to a survey in a Facebook group with potential customers, post that you’re doing a research project and would love to interview some people that do [whatever your target market does].

Here’s my theory: People don’t like filling out surveys because it feels cold, and impersonal. On the other hand, answering questions being asked by a human interviewer, even if they are the same questions, makes them feel important because of the personal touch. Someone else is taking time from their day to ask the questions, so it’s more reciprocal.

Continue reading