In my ever ongoing (6 years!) development of an Instapaper client for Windows, I’ve reached the point where the app is very nearly done. But before I unleashed it on the world, I knew I need to add telemetry to the app. But which service to send it to?
Turns out no one did that. No one has written a C++ client, or a pure JS implementation meant for offline delivery (E.g. in package). So this set me off on a journey to build my own.
Thus my next requirement was a well documented HTTP API: Turns out those are pretty rare too! After much searching I found Mixpanel:
- Great Documentation
- Good reference source to understand those poorly captured peccadilloes
And so I embarked on writing a C++/CX library for uploading to Mixpanel — and 1.5 years later, I’ve finished it, and published v1.0 to the world.
Things that happened along the way:
- Created a background work queue for processing items, and handing off to some other worker. Turns out there aren’t any good, simple ones for C++ — at least that I could find.
- Learned all about using the stl threading primitives for my worker. I still don’t quite get why there isn’t “Mutex” in the STL that I can create and wait on till it’s signaled — since it really tries hard to take ownership on creation, and on obtaining the lock (rather than waiting to be signaled)
- Created many unit tests to make sure I wasn’t a muppet. And proved that just because you have unit tests doesn’t mean you got it right (see the most recent unit test I added)
- Learned about creating & publishing nuget packages, including getting an update published to the nuget documentation.
- Thought way to deeply about the overall architecture
- Accepted the right thing to do was make private APIs visible to my test code to keep a clean public API
Anyway, I hope it’s useful to someone that isn’t me, and I’m interested in feedback, and suggestions.